Tizen 2.1 base
[platform/upstream/libbullet.git] / Extras / PhysicsEffects / include / physics_effects / base_level / solver / pfx_joint_swing_twist.h
1 /*\r
2 Physics Effects Copyright(C) 2010 Sony Computer Entertainment Inc.\r
3 All rights reserved.\r
4 \r
5 Physics Effects is open software; you can redistribute it and/or\r
6 modify it under the terms of the BSD License.\r
7 \r
8 Physics Effects is distributed in the hope that it will be useful,\r
9 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
11 See the BSD License for more details.\r
12 \r
13 A copy of the BSD License is distributed with\r
14 Physics Effects under the filename: physics_effects_license.txt\r
15 */\r
16 \r
17 #ifndef _SCE_PFX_JOINT_SWING_TWIST_H\r
18 #define _SCE_PFX_JOINT_SWING_TWIST_H\r
19 \r
20 #include "pfx_joint.h"\r
21 #include "pfx_solver_body.h"\r
22 namespace sce {\r
23 namespace PhysicsEffects {\r
24 \r
25 struct PfxSwingTwistJointInitParam {\r
26         PfxVector3 anchorPoint;\r
27         PfxVector3 twistAxis;\r
28         PfxFloat twistLowerAngle;\r
29         PfxFloat twistUpperAngle;\r
30         PfxFloat swingLowerAngle;\r
31         PfxFloat swingUpperAngle;\r
32         \r
33         PfxSwingTwistJointInitParam()\r
34         {\r
35                 anchorPoint = PfxVector3(0.0f);\r
36                 twistAxis = PfxVector3(1.0f,0.0f,0.0f);\r
37                 twistLowerAngle = -0.26f;\r
38                 twistUpperAngle =  0.26f;\r
39                 swingLowerAngle = 0.0f;\r
40                 swingUpperAngle = 0.7f;\r
41         }\r
42 };\r
43 \r
44 PfxInt32 pfxInitializeSwingTwistJoint(\r
45         PfxJoint &joint,\r
46         const PfxRigidState &stateA,\r
47         const PfxRigidState &stateB,\r
48         const PfxSwingTwistJointInitParam &param);\r
49 \r
50 void pfxSetupSwingTwistJoint(\r
51         PfxJoint &joint,\r
52         const PfxRigidState &stateA,\r
53         const PfxRigidState &stateB,\r
54         PfxSolverBody &solverBodyA,\r
55         PfxSolverBody &solverBodyB,\r
56         PfxFloat timeStep);\r
57 \r
58 void pfxWarmStartSwingTwistJoint(\r
59         PfxJoint &joint,\r
60         PfxSolverBody &solverBodyA,\r
61         PfxSolverBody &solverBodyB);\r
62 \r
63 void pfxSolveSwingTwistJoint(\r
64         PfxJoint &joint,\r
65         PfxSolverBody &solverBodyA,\r
66         PfxSolverBody &solverBodyB);\r
67 \r
68 } //namespace PhysicsEffects\r
69 } //namespace sce\r
70 #endif // _SCE_PFX_JOINT_SWING_TWIST_H\r