Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
PhysXActor.cpp
Go to the documentation of this file.
1
2
4
7
8namespace Divide {
9namespace Util {
10 vec3<F32> toVec3(const physx::PxVec3& vec) noexcept {
11 return { vec.x, vec.y, vec.z };
12 }
13
14 physx::PxVec3 toVec3(const vec3<F32>& vec) noexcept {
15 return { vec.x, vec.y, vec.z };
16 }
17} //namespace Util
18
21 {
22 }
23
25 {
26 if (_actor != nullptr) {
27 _actor->release();
28 }
29 }
30
32 void PhysXActor::setPosition(const vec3<F32>& position) {
33 setPosition(position.x, position.y, position.z);
34 }
35
37 void PhysXActor::setPosition(const F32 x, const F32 y, const F32 z) {
41 }
42
44 void PhysXActor::setPositionX(const F32 positionX) {
45 DIVIDE_UNUSED(positionX);
46
47 }
49 void PhysXActor::setPositionY(const F32 positionY) {
50 DIVIDE_UNUSED(positionY);
51
52 }
54 void PhysXActor::setPositionZ(const F32 positionZ) {
55 DIVIDE_UNUSED(positionZ);
56 }
57
59 void PhysXActor::setScale(const vec3<F32>& scale) {
61 }
62
66 DIVIDE_UNUSED(axis);
67 DIVIDE_UNUSED(degrees);
68 }
69
73 DIVIDE_UNUSED(pitch);
74 DIVIDE_UNUSED(yaw);
75 DIVIDE_UNUSED(roll);
76 }
77
80 DIVIDE_UNUSED(quat);
81 }
82
84 void PhysXActor::translate(const vec3<F32>& axisFactors) {
85 DIVIDE_UNUSED(axisFactors);
86 }
87
89 void PhysXActor::scale(const vec3<F32>& axisFactors) {
90 DIVIDE_UNUSED(axisFactors);
91 }
92
97 DIVIDE_UNUSED(axis);
98 DIVIDE_UNUSED(degrees);
99 }
100
105 DIVIDE_UNUSED(pitch);
106 DIVIDE_UNUSED(yaw);
107 DIVIDE_UNUSED(roll);
108 }
109
112 DIVIDE_UNUSED(quat);
113 }
114
116 void PhysXActor::rotateSlerp(const Quaternion<F32>& quat, const D64 deltaTime) {
117 DIVIDE_UNUSED(quat);
118 DIVIDE_UNUSED(deltaTime);
119 }
120
122 void PhysXActor::setScaleX(const F32 amount) {
123 DIVIDE_UNUSED(amount);
124 }
125
127 void PhysXActor::setScaleY(const F32 amount) {
128 DIVIDE_UNUSED(amount);
129 }
130
132 void PhysXActor::setScaleZ(const F32 amount) {
133 DIVIDE_UNUSED(amount);
134 }
135
137 void PhysXActor::scaleX(const F32 amount) {
138 DIVIDE_UNUSED( amount );
139 }
140
142 void PhysXActor::scaleY(const F32 amount) {
143 DIVIDE_UNUSED( amount );
144 }
145
147 void PhysXActor::scaleZ(const F32 amount) {
148 DIVIDE_UNUSED( amount );
149 }
150
154 DIVIDE_UNUSED( angle );
155 }
156
160 DIVIDE_UNUSED( angle );
161 }
162
166 DIVIDE_UNUSED( angle );
167 }
168
172 DIVIDE_UNUSED( angle );
173 }
174
178 DIVIDE_UNUSED( angle );
179 }
180
184 DIVIDE_UNUSED( angle );
185 }
186
188 void PhysXActor::getScale(vec3<F32>& scaleOut) const {
189 scaleOut.set(1.0f);
190 }
191
193 void PhysXActor::getPosition(vec3<F32>& posOut) const {
194 posOut.set(0.0f);
195 }
196
199 quatOut.identity();
200 }
201
203 if (_parentComponent.physicsCollisionGroup() != group && _actor != nullptr) {
204 _context.convertActor(this, group);
205 }
206
208 }
209
210} //namespace Divide
#define DIVIDE_UNUSED(X)
bool convertActor(PhysicsAsset *actor, PhysicsGroup newGroup) override
Definition: PXDevice.cpp:124
void setPositionZ(F32 positionZ) override
Set the object's position on the Z axis.
Definition: PhysXActor.cpp:54
PhysXActor(RigidBodyComponent &parent) noexcept
Definition: PhysXActor.cpp:19
void setPositionX(F32 positionX) override
Set the object's position on the X axis.
Definition: PhysXActor.cpp:44
void setScaleX(F32 amount) override
Set the scaling factor on the X axis.
Definition: PhysXActor.cpp:122
void setScaleZ(F32 amount) override
Set the scaling factor on the Z axis.
Definition: PhysXActor.cpp:132
void setPosition(const vec3< F32 > &position) override
Set the local X,Y and Z position.
Definition: PhysXActor.cpp:32
void rotateSlerp(const Quaternion< F32 > &quat, D64 deltaTime) override
Perform a SLERP rotation towards the specified quaternion.
Definition: PhysXActor.cpp:116
void setRotationX(Angle::DEGREES< F32 > angle) override
Definition: PhysXActor.cpp:171
physx::PxRigidActor * _actor
Definition: PhysXActor.h:99
void setScaleY(F32 amount) override
Set the scaling factor on the Y axis.
Definition: PhysXActor.cpp:127
void setPositionY(F32 positionY) override
Set the object's position on the Y axis.
Definition: PhysXActor.cpp:49
void getScale(vec3< F32 > &scaleOut) const override
Return the scale factor.
Definition: PhysXActor.cpp:188
void getOrientation(Quaternion< F32 > &quatOut) const override
Return the orientation quaternion.
Definition: PhysXActor.cpp:198
void scale(const vec3< F32 > &axisFactors) override
Add the specified scale factors to the current local position.
Definition: PhysXActor.cpp:89
void setRotationY(Angle::DEGREES< F32 > angle) override
Definition: PhysXActor.cpp:177
void rotateZ(Angle::DEGREES< F32 > angle) override
Definition: PhysXActor.cpp:165
void scaleX(F32 amount) override
Increase the scaling factor on the X axis by the specified factor.
Definition: PhysXActor.cpp:137
void rotate(const vec3< F32 > &axis, Angle::DEGREES< F32 > degrees) override
Definition: PhysXActor.cpp:96
void getPosition(vec3< F32 > &posOut) const override
Return the position.
Definition: PhysXActor.cpp:193
void setRotationZ(Angle::DEGREES< F32 > angle) override
Definition: PhysXActor.cpp:183
void scaleZ(F32 amount) override
Increase the scaling factor on the Z axis by the specified factor.
Definition: PhysXActor.cpp:147
void translate(const vec3< F32 > &axisFactors) override
Add the specified translation factors to the current local position.
Definition: PhysXActor.cpp:84
~PhysXActor() override
Definition: PhysXActor.cpp:24
void scaleY(F32 amount) override
Increase the scaling factor on the Y axis by the specified factor.
Definition: PhysXActor.cpp:142
void physicsCollisionGroup(PhysicsGroup group) override
Definition: PhysXActor.cpp:202
void setRotation(const vec3< F32 > &axis, Angle::DEGREES< F32 > degrees) override
Definition: PhysXActor.cpp:65
void rotateX(Angle::DEGREES< F32 > angle) override
Definition: PhysXActor.cpp:153
void setScale(const vec3< F32 > &scale) override
Set the local X,Y and Z scale factors.
Definition: PhysXActor.cpp:59
void rotateY(Angle::DEGREES< F32 > angle) override
Definition: PhysXActor.cpp:159
virtual void physicsCollisionGroup(PhysicsGroup group)
RigidBodyComponent & _parentComponent
Definition: PhysicsAsset.h:52
void identity() noexcept
Definition: Quaternion.inl:657
void physicsCollisionGroup(PhysicsGroup group)
void set(const T *v) noexcept
set the 3 components of the vector manually using a source pointer to a (large enough) array
Definition: MathVectors.h:707
vec3< F32 > toVec3(const physx::PxVec3 &vec) noexcept
Definition: PhysXActor.cpp:10
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
Project & parent
Definition: DefaultScene.h:41
double D64