orx  stable
Portable Game Engine
orxBody.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
46 #ifndef _orxBODY_H_
47 #define _orxBODY_H_
48 
49 #include "orxInclude.h"
50 
51 #include "object/orxStructure.h"
52 #include "physics/orxPhysics.h"
53 
54 
57 typedef struct __orxBODY_t orxBODY;
58 
61 typedef struct __orxBODY_PART_t orxBODY_PART;
62 
65 typedef struct __orxBODY_JOINT_t orxBODY_JOINT;
66 
67 
70 extern orxDLLAPI void orxFASTCALL orxBody_Setup();
71 
74 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_Init();
75 
78 extern orxDLLAPI void orxFASTCALL orxBody_Exit();
79 
80 
86 extern orxDLLAPI orxBODY *orxFASTCALL orxBody_Create(const orxSTRUCTURE *_pstOwner, const orxBODY_DEF *_pstBodyDef);
87 
93 extern orxDLLAPI orxBODY *orxFASTCALL orxBody_CreateFromConfig(const orxSTRUCTURE *_pstOwner, const orxSTRING _zConfigID);
94 
99 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_Delete(orxBODY *_pstBody);
100 
105 extern orxDLLAPI const orxSTRING orxFASTCALL orxBody_GetName(const orxBODY *_pstBody);
106 
107 
113 extern orxDLLAPI orxBOOL orxFASTCALL orxBody_TestDefFlags(const orxBODY *_pstBody, orxU32 _u32Flags);
114 
120 extern orxDLLAPI orxBOOL orxFASTCALL orxBody_TestAllDefFlags(const orxBODY *_pstBody, orxU32 _u32Flags);
121 
127 extern orxDLLAPI orxU32 orxFASTCALL orxBody_GetDefFlags(const orxBODY *_pstBody, orxU32 _u32Mask);
128 
129 
135 extern orxDLLAPI orxBODY_PART *orxFASTCALL orxBody_AddPart(orxBODY *_pstBody, const orxBODY_PART_DEF *_pstBodyPartDef);
136 
142 extern orxDLLAPI orxBODY_PART *orxFASTCALL orxBody_AddPartFromConfig(orxBODY *_pstBody, const orxSTRING _zConfigID);
143 
149 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_RemovePartFromConfig(orxBODY *_pstBody, const orxSTRING _zConfigID);
150 
156 extern orxDLLAPI orxBODY_PART *orxFASTCALL orxBody_GetNextPart(const orxBODY *_pstBody, const orxBODY_PART *_pstBodyPart);
157 
162 extern orxDLLAPI const orxSTRING orxFASTCALL orxBody_GetPartName(const orxBODY_PART *_pstBodyPart);
163 
168 extern orxDLLAPI const orxBODY_PART_DEF *orxFASTCALL orxBody_GetPartDef(const orxBODY_PART *_pstBodyPart);
169 
174 extern orxDLLAPI orxBODY *orxFASTCALL orxBody_GetPartBody(const orxBODY_PART *_pstBodyPart);
175 
180 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_RemovePart(orxBODY_PART *_pstBodyPart);
181 
182 
189 extern orxDLLAPI orxBODY_JOINT *orxFASTCALL orxBody_AddJoint(orxBODY *_pstSrcBody, orxBODY *_pstDstBody, const orxBODY_JOINT_DEF *_pstBodyJointDef);
190 
197 extern orxDLLAPI orxBODY_JOINT *orxFASTCALL orxBody_AddJointFromConfig(orxBODY *_pstSrcBody, orxBODY *_pstDstBody, const orxSTRING _zConfigID);
198 
204 extern orxDLLAPI orxBODY_JOINT *orxFASTCALL orxBody_GetNextJoint(const orxBODY *_pstBody, const orxBODY_JOINT *_pstBodyJoint);
205 
210 extern orxDLLAPI const orxSTRING orxFASTCALL orxBody_GetJointName(const orxBODY_JOINT *_pstBodyJoint);
211 
216 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_RemoveJoint(orxBODY_JOINT *_pstBodyJoint);
217 
218 
224 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPosition(orxBODY *_pstBody, const orxVECTOR *_pvPosition);
225 
231 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetRotation(orxBODY *_pstBody, orxFLOAT _fRotation);
232 
238 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetScale(orxBODY *_pstBody, const orxVECTOR *_pvScale);
239 
245 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetSpeed(orxBODY *_pstBody, const orxVECTOR *_pvSpeed);
246 
252 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetAngularVelocity(orxBODY *_pstBody, orxFLOAT _fVelocity);
253 
259 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetCustomGravity(orxBODY *_pstBody, const orxVECTOR *_pvCustomGravity);
260 
266 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetFixedRotation(orxBODY *_pstBody, orxBOOL _bFixed);
267 
273 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetPosition(const orxBODY *_pstBody, orxVECTOR *_pvPosition);
274 
279 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetRotation(const orxBODY *_pstBody);
280 
286 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetSpeed(const orxBODY *_pstBody, orxVECTOR *_pvSpeed);
287 
294 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetSpeedAtWorldPosition(const orxBODY *_pstBody, const orxVECTOR *_pvPosition, orxVECTOR *_pvSpeed);
295 
300 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetAngularVelocity(const orxBODY *_pstBody);
301 
307 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetCustomGravity(const orxBODY *_pstBody, orxVECTOR *_pvCustomGravity);
308 
313 extern orxDLLAPI orxBOOL orxFASTCALL orxBody_IsFixedRotation(const orxBODY *_pstBody);
314 
319 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetMass(const orxBODY *_pstBody);
320 
326 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetMassCenter(const orxBODY *_pstBody, orxVECTOR *_pvMassCenter);
327 
328 
334 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetLinearDamping(orxBODY *_pstBody, orxFLOAT _fDamping);
335 
341 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetAngularDamping(orxBODY *_pstBody, orxFLOAT _fDamping);
342 
347 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetLinearDamping(const orxBODY *_pstBody);
348 
353 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetAngularDamping(const orxBODY *_pstBody);
354 
355 
361 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_ApplyTorque(orxBODY *_pstBody, orxFLOAT _fTorque);
362 
369 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_ApplyForce(orxBODY *_pstBody, const orxVECTOR *_pvForce, const orxVECTOR *_pvPoint);
370 
377 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_ApplyImpulse(orxBODY *_pstBody, const orxVECTOR *_pvImpulse, const orxVECTOR *_pvPoint);
378 
379 
385 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPartSelfFlags(orxBODY_PART *_pstBodyPart, orxU16 _u16SelfFlags);
386 
392 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPartCheckMask(orxBODY_PART *_pstBodyPart, orxU16 _u16CheckMask);
393 
398 extern orxDLLAPI orxU16 orxFASTCALL orxBody_GetPartSelfFlags(const orxBODY_PART *_pstBodyPart);
399 
404 extern orxDLLAPI orxU16 orxFASTCALL orxBody_GetPartCheckMask(const orxBODY_PART *_pstBodyPart);
405 
410 extern orxDLLAPI orxBOOL orxFASTCALL orxBody_IsPartSolid(const orxBODY_PART *_pstBodyPart);
411 
417 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPartSolid(orxBODY_PART *_pstBodyPart, orxBOOL _bSolid);
418 
419 
425 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_EnableMotor(orxBODY_JOINT *_pstBodyJoint, orxBOOL _bEnable);
426 
432 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetJointMotorSpeed(orxBODY_JOINT *_pstBodyJoint, orxFLOAT _fSpeed);
433 
439 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetJointMaxMotorTorque(orxBODY_JOINT *_pstBodyJoint, orxFLOAT _fMaxTorque);
440 
441 
447 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetJointReactionForce(const orxBODY_JOINT *_pstBodyJoint, orxVECTOR *_pvForce);
448 
453 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetJointReactionTorque(const orxBODY_JOINT *_pstBodyJoint);
454 
455 
466 extern orxDLLAPI orxBODY *orxFASTCALL orxBody_Raycast(const orxVECTOR *_pvStart, const orxVECTOR *_pvEnd, orxU16 _u16SelfFlags, orxU16 _u16CheckMask, orxBOOL _bEarlyExit, orxVECTOR *_pvContact, orxVECTOR *_pvNormal);
467 
468 #endif /* _orxBODY_H_ */
469 
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetJointMotorSpeed(orxBODY_JOINT *_pstBodyJoint, orxFLOAT _fSpeed)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_ApplyTorque(orxBODY *_pstBody, orxFLOAT _fTorque)
orxDLLAPI const orxSTRING orxFASTCALL orxBody_GetName(const orxBODY *_pstBody)
orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetRotation(const orxBODY *_pstBody)
orxDLLAPI orxU32 orxFASTCALL orxBody_GetDefFlags(const orxBODY *_pstBody, orxU32 _u32Mask)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_RemovePart(orxBODY_PART *_pstBodyPart)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetSpeed(orxBODY *_pstBody, const orxVECTOR *_pvSpeed)
orxDLLAPI orxBODY *orxFASTCALL orxBody_Raycast(const orxVECTOR *_pvStart, const orxVECTOR *_pvEnd, orxU16 _u16SelfFlags, orxU16 _u16CheckMask, orxBOOL _bEarlyExit, orxVECTOR *_pvContact, orxVECTOR *_pvNormal)
orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetMass(const orxBODY *_pstBody)
orxDLLAPI orxBOOL orxFASTCALL orxBody_TestAllDefFlags(const orxBODY *_pstBody, orxU32 _u32Flags)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPartSelfFlags(orxBODY_PART *_pstBodyPart, orxU16 _u16SelfFlags)
orxDLLAPI orxBODY *orxFASTCALL orxBody_GetPartBody(const orxBODY_PART *_pstBodyPart)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_Init()
orxDLLAPI orxSTATUS orxFASTCALL orxBody_ApplyForce(orxBODY *_pstBody, const orxVECTOR *_pvForce, const orxVECTOR *_pvPoint)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetAngularDamping(orxBODY *_pstBody, orxFLOAT _fDamping)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPartSolid(orxBODY_PART *_pstBodyPart, orxBOOL _bSolid)
orxDLLAPI orxBODY_PART *orxFASTCALL orxBody_AddPart(orxBODY *_pstBody, const orxBODY_PART_DEF *_pstBodyPartDef)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_RemoveJoint(orxBODY_JOINT *_pstBodyJoint)
orxDLLAPI const orxBODY_PART_DEF *orxFASTCALL orxBody_GetPartDef(const orxBODY_PART *_pstBodyPart)
orxDLLAPI orxU16 orxFASTCALL orxBody_GetPartCheckMask(const orxBODY_PART *_pstBodyPart)
orxDLLAPI orxBOOL orxFASTCALL orxBody_TestDefFlags(const orxBODY *_pstBody, orxU32 _u32Flags)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_RemovePartFromConfig(orxBODY *_pstBody, const orxSTRING _zConfigID)
orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetJointReactionTorque(const orxBODY_JOINT *_pstBodyJoint)
orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetAngularDamping(const orxBODY *_pstBody)
orxDLLAPI orxBOOL orxFASTCALL orxBody_IsPartSolid(const orxBODY_PART *_pstBodyPart)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetFixedRotation(orxBODY *_pstBody, orxBOOL _bFixed)
orxDLLAPI orxBODY_JOINT *orxFASTCALL orxBody_AddJointFromConfig(orxBODY *_pstSrcBody, orxBODY *_pstDstBody, const orxSTRING _zConfigID)
orxDLLAPI orxBOOL orxFASTCALL orxBody_IsFixedRotation(const orxBODY *_pstBody)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_EnableMotor(orxBODY_JOINT *_pstBodyJoint, orxBOOL _bEnable)
orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetJointReactionForce(const orxBODY_JOINT *_pstBodyJoint, orxVECTOR *_pvForce)
orxDLLAPI orxBODY *orxFASTCALL orxBody_Create(const orxSTRUCTURE *_pstOwner, const orxBODY_DEF *_pstBodyDef)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_ApplyImpulse(orxBODY *_pstBody, const orxVECTOR *_pvImpulse, const orxVECTOR *_pvPoint)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetLinearDamping(orxBODY *_pstBody, orxFLOAT _fDamping)
orxDLLAPI orxBODY_JOINT *orxFASTCALL orxBody_GetNextJoint(const orxBODY *_pstBody, const orxBODY_JOINT *_pstBodyJoint)
orxSTATUS
Definition: orxType.h:243
struct __orxBODY_PART_t orxBODY_PART
Definition: orxBody.h:61
orxDLLAPI orxBODY_JOINT *orxFASTCALL orxBody_AddJoint(orxBODY *_pstSrcBody, orxBODY *_pstDstBody, const orxBODY_JOINT_DEF *_pstBodyJointDef)
orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetCustomGravity(const orxBODY *_pstBody, orxVECTOR *_pvCustomGravity)
struct __orxBODY_JOINT_t orxBODY_JOINT
Definition: orxBody.h:65
orxDLLAPI orxBODY_PART *orxFASTCALL orxBody_GetNextPart(const orxBODY *_pstBody, const orxBODY_PART *_pstBodyPart)
#define orxDLLAPI
Definition: orxDecl.h:387
orxDLLAPI orxU16 orxFASTCALL orxBody_GetPartSelfFlags(const orxBODY_PART *_pstBodyPart)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPosition(orxBODY *_pstBody, const orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_Delete(orxBODY *_pstBody)
struct __orxBODY_t orxBODY
Definition: orxBody.h:57
orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetMassCenter(const orxBODY *_pstBody, orxVECTOR *_pvMassCenter)
orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetSpeed(const orxBODY *_pstBody, orxVECTOR *_pvSpeed)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetCustomGravity(orxBODY *_pstBody, const orxVECTOR *_pvCustomGravity)
orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetLinearDamping(const orxBODY *_pstBody)
orxDLLAPI orxBODY *orxFASTCALL orxBody_CreateFromConfig(const orxSTRUCTURE *_pstOwner, const orxSTRING _zConfigID)
orxDLLAPI const orxSTRING orxFASTCALL orxBody_GetJointName(const orxBODY_JOINT *_pstBodyJoint)
orxDLLAPI orxBODY_PART *orxFASTCALL orxBody_AddPartFromConfig(orxBODY *_pstBody, const orxSTRING _zConfigID)
orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetAngularVelocity(const orxBODY *_pstBody)
orxDLLAPI const orxSTRING orxFASTCALL orxBody_GetPartName(const orxBODY_PART *_pstBodyPart)
orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetSpeedAtWorldPosition(const orxBODY *_pstBody, const orxVECTOR *_pvPosition, orxVECTOR *_pvSpeed)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetAngularVelocity(orxBODY *_pstBody, orxFLOAT _fVelocity)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPartCheckMask(orxBODY_PART *_pstBodyPart, orxU16 _u16CheckMask)
orxDLLAPI void orxFASTCALL orxBody_Setup()
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetRotation(orxBODY *_pstBody, orxFLOAT _fRotation)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetJointMaxMotorTorque(orxBODY_JOINT *_pstBodyJoint, orxFLOAT _fMaxTorque)
orxDLLAPI void orxFASTCALL orxBody_Exit()
orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetPosition(const orxBODY *_pstBody, orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetScale(orxBODY *_pstBody, const orxVECTOR *_pvScale)

Generated for orx by doxygen 1.5.6