summaryrefslogtreecommitdiff
path: root/Runtime/Dynamics/BoxCollider.h
blob: 078467aa03697627961cf1c9f7cbd5e2d07d03f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef BOXCOLLIDER_H
#define BOXCOLLIDER_H

#include "Collider.h"
#include "Runtime/Math/Vector3.h"

class BoxCollider : public Collider
{
 public:	
	REGISTER_DERIVED_CLASS (BoxCollider, Collider)
	DECLARE_OBJECT_SERIALIZE (BoxCollider)
		
	BoxCollider (MemLabelId label, ObjectCreationMode mode);
			
	virtual void Reset ();
	virtual void SmartReset ();
	virtual void AwakeFromLoad(AwakeFromLoadMode mode);

	const Vector3f& GetSize () const { return m_Size; }
	void SetSize (const Vector3f& extents);

	const Vector3f& GetCenter () const { return m_Center; }
	void SetCenter (const Vector3f& pos);
	
	Vector3f GetGlobalExtents () const;
	Vector3f GetGlobalCenter () const;
	
	virtual void TransformChanged (int changeMask);

	protected:
	
	virtual void FetchPoseFromTransform ();
	virtual bool GetRelativeToParentPositionAndRotation (Transform& transform, Transform& anyParent, Matrix4x4f& matrix);

		
	virtual void Create (const Rigidbody* ignoreRigidbody);
	virtual void ScaleChanged ();

	virtual NxCCDSkeleton* CreateCCDSkeleton(float scale);
	
	Vector3f m_Center;
	Vector3f m_Size;
};

#endif