xref: /haiku/src/apps/haiku3d/MeshInstance.h (revision bee3c7a91530d16bc444d3c10720b16783ba1bed)
1*bee3c7a9SAlexandre Deckner /*
2*bee3c7a9SAlexandre Deckner  * Copyright 2009, Haiku Inc. All rights reserved.
3*bee3c7a9SAlexandre Deckner  * Distributed under the terms of the MIT License.
4*bee3c7a9SAlexandre Deckner  *
5*bee3c7a9SAlexandre Deckner  * Authors:
6*bee3c7a9SAlexandre Deckner  * 		Alexandre Deckner <alex@zappotek.com>
7*bee3c7a9SAlexandre Deckner  */
8*bee3c7a9SAlexandre Deckner 
9*bee3c7a9SAlexandre Deckner #ifndef _MESH_INSTANCE_H
10*bee3c7a9SAlexandre Deckner #define _MESH_INSTANCE_H
11*bee3c7a9SAlexandre Deckner 
12*bee3c7a9SAlexandre Deckner #include "Mesh.h"
13*bee3c7a9SAlexandre Deckner #include "Texture.h"
14*bee3c7a9SAlexandre Deckner #include "Vector3.h"
15*bee3c7a9SAlexandre Deckner #include "Quaternion.h"
16*bee3c7a9SAlexandre Deckner 
17*bee3c7a9SAlexandre Deckner 
18*bee3c7a9SAlexandre Deckner class MeshInstance {
19*bee3c7a9SAlexandre Deckner public:
20*bee3c7a9SAlexandre Deckner 				MeshInstance(Mesh* mesh, Texture* texture,
21*bee3c7a9SAlexandre Deckner 					const Vector3& position, const Quaternion& orientation,
22*bee3c7a9SAlexandre Deckner 					float animOffset);
23*bee3c7a9SAlexandre Deckner 				~MeshInstance();
24*bee3c7a9SAlexandre Deckner 
25*bee3c7a9SAlexandre Deckner 	void		Update(float dt);
26*bee3c7a9SAlexandre Deckner 	void		Render();
27*bee3c7a9SAlexandre Deckner 
28*bee3c7a9SAlexandre Deckner protected:
29*bee3c7a9SAlexandre Deckner 	Reference<Mesh>		fMeshReference;
30*bee3c7a9SAlexandre Deckner 	Reference<Texture>	fTextureReference;
31*bee3c7a9SAlexandre Deckner 
32*bee3c7a9SAlexandre Deckner 	Vector3		fPosition;
33*bee3c7a9SAlexandre Deckner 	Quaternion	fOrientation;
34*bee3c7a9SAlexandre Deckner 	float		fScale;
35*bee3c7a9SAlexandre Deckner 
36*bee3c7a9SAlexandre Deckner 	// TODO: manage the animation externally
37*bee3c7a9SAlexandre Deckner 	float		fTime;
38*bee3c7a9SAlexandre Deckner 	float		fAnimOffset;
39*bee3c7a9SAlexandre Deckner 
40*bee3c7a9SAlexandre Deckner 	bool		fDoubleSided;
41*bee3c7a9SAlexandre Deckner 	bool		fDrawNormals;
42*bee3c7a9SAlexandre Deckner };
43*bee3c7a9SAlexandre Deckner 
44*bee3c7a9SAlexandre Deckner #endif /* _MESH_INSTANCE_H */
45