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