orx  1.10
Portable Game Engine
orxBody.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2019 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 orxSTATUS orxFASTCALL orxBody_SetDynamic(orxBODY *_pstBody, orxBOOL _bDynamic);
274 
280 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetAllowMoving(orxBODY *_pstBody, orxBOOL _bAllowMoving);
281 
287 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetPosition(const orxBODY *_pstBody, orxVECTOR *_pvPosition);
288 
293 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetRotation(const orxBODY *_pstBody);
294 
300 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetSpeed(const orxBODY *_pstBody, orxVECTOR *_pvSpeed);
301 
308 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetSpeedAtWorldPosition(const orxBODY *_pstBody, const orxVECTOR *_pvPosition, orxVECTOR *_pvSpeed);
309 
314 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetAngularVelocity(const orxBODY *_pstBody);
315 
321 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetCustomGravity(const orxBODY *_pstBody, orxVECTOR *_pvCustomGravity);
322 
327 extern orxDLLAPI orxBOOL orxFASTCALL orxBody_IsFixedRotation(const orxBODY *_pstBody);
328 
333 extern orxDLLAPI orxBOOL orxFASTCALL orxBody_IsDynamic(const orxBODY *_pstBody);
334 
339 extern orxDLLAPI orxBOOL orxFASTCALL orxBody_GetAllowMoving(const orxBODY *_pstBody);
340 
345 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetMass(const orxBODY *_pstBody);
346 
352 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetMassCenter(const orxBODY *_pstBody, orxVECTOR *_pvMassCenter);
353 
354 
360 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetLinearDamping(orxBODY *_pstBody, orxFLOAT _fDamping);
361 
367 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetAngularDamping(orxBODY *_pstBody, orxFLOAT _fDamping);
368 
373 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetLinearDamping(const orxBODY *_pstBody);
374 
379 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetAngularDamping(const orxBODY *_pstBody);
380 
381 
387 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_ApplyTorque(orxBODY *_pstBody, orxFLOAT _fTorque);
388 
395 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_ApplyForce(orxBODY *_pstBody, const orxVECTOR *_pvForce, const orxVECTOR *_pvPoint);
396 
403 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_ApplyImpulse(orxBODY *_pstBody, const orxVECTOR *_pvImpulse, const orxVECTOR *_pvPoint);
404 
405 
411 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPartSelfFlags(orxBODY_PART *_pstBodyPart, orxU16 _u16SelfFlags);
412 
418 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPartCheckMask(orxBODY_PART *_pstBodyPart, orxU16 _u16CheckMask);
419 
424 extern orxDLLAPI orxU16 orxFASTCALL orxBody_GetPartSelfFlags(const orxBODY_PART *_pstBodyPart);
425 
430 extern orxDLLAPI orxU16 orxFASTCALL orxBody_GetPartCheckMask(const orxBODY_PART *_pstBodyPart);
431 
436 extern orxDLLAPI orxBOOL orxFASTCALL orxBody_IsPartSolid(const orxBODY_PART *_pstBodyPart);
437 
443 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetPartSolid(orxBODY_PART *_pstBodyPart, orxBOOL _bSolid);
444 
445 
451 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_EnableMotor(orxBODY_JOINT *_pstBodyJoint, orxBOOL _bEnable);
452 
458 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetJointMotorSpeed(orxBODY_JOINT *_pstBodyJoint, orxFLOAT _fSpeed);
459 
465 extern orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetJointMaxMotorTorque(orxBODY_JOINT *_pstBodyJoint, orxFLOAT _fMaxTorque);
466 
467 
473 extern orxDLLAPI orxVECTOR *orxFASTCALL orxBody_GetJointReactionForce(const orxBODY_JOINT *_pstBodyJoint, orxVECTOR *_pvForce);
474 
479 extern orxDLLAPI orxFLOAT orxFASTCALL orxBody_GetJointReactionTorque(const orxBODY_JOINT *_pstBodyJoint);
480 
481 
492 extern orxDLLAPI orxBODY *orxFASTCALL orxBody_Raycast(const orxVECTOR *_pvBegin, const orxVECTOR *_pvEnd, orxU16 _u16SelfFlags, orxU16 _u16CheckMask, orxBOOL _bEarlyExit, orxVECTOR *_pvContact, orxVECTOR *_pvNormal);
493 
494 #endif /* _orxBODY_H_ */
495 
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 orxFLOAT orxFASTCALL orxBody_GetMass(const orxBODY *_pstBody)
orxDLLAPI orxSTATUS orxFASTCALL orxBody_SetDynamic(orxBODY *_pstBody, orxBOOL _bDynamic)
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 orxBOOL orxFASTCALL orxBody_IsDynamic(const orxBODY *_pstBody)
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 orxBOOL orxFASTCALL orxBody_GetAllowMoving(const orxBODY *_pstBody)
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 orxSTATUS orxFASTCALL orxBody_SetAllowMoving(orxBODY *_pstBody, orxBOOL _bAllowMoving)
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:246
orxDLLAPI orxBODY *orxFASTCALL orxBody_Raycast(const orxVECTOR *_pvBegin, const orxVECTOR *_pvEnd, orxU16 _u16SelfFlags, orxU16 _u16CheckMask, orxBOOL _bEarlyExit, orxVECTOR *_pvContact, orxVECTOR *_pvNormal)
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:381
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.8.11