2 Physics Effects Copyright(C) 2011 Sony Computer Entertainment Inc.
\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
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
13 A copy of the BSD License is distributed with
\r
14 Physics Effects under the filename: physics_effects_license.txt
\r
17 #ifndef _BT_PARALLEL_DYNAMICS_WORLD_H
\r
18 #define _BT_PARALLEL_DYNAMICS_WORLD_H
\r
20 #include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
\r
21 #include "physics_effects/base_level/rigidbody/pfx_rigid_body.h"
\r
22 #include "physics_effects/base_level/rigidbody/pfx_rigid_state.h"
\r
23 #include "physics_effects/base_level/collision/pfx_collidable.h"
\r
24 #include "physics_effects/base_level/solver/pfx_solver_body.h"
\r
26 //#define USE_PE_GATHER_SCATTER_SPURS_TASK 1
\r
29 class btThreadSupportInterface;
\r
30 class SpuPEGatherScatterTaskProcess;
\r
32 class SpuBatchRaycaster;
\r
33 struct btLowLevelBroadphase;
\r
35 #define PARALLEL_BATCH_SIZE 64
\r
38 ///btBulletPhysicsEffectsWorld adds parallel processing for integration/motion prediction
\r
39 class btBulletPhysicsEffectsWorld : public btDiscreteDynamicsWorld
\r
43 btAlignedObjectArray<sce::PhysicsEffects::PfxRigidState> m_lowLevelStates;
\r
44 btAlignedObjectArray<sce::PhysicsEffects::PfxRigidBody> m_lowLevelBodies;
\r
45 btAlignedObjectArray<sce::PhysicsEffects::PfxSolverBody> m_lowLevelSolverBodies;
\r
46 btAlignedObjectArray<sce::PhysicsEffects::PfxCollidable> m_lowLevelCollidables;
\r
48 //PfxSolverBody solverBodies[NUM_RIGIDBODIES];
\r
50 class SpuPEGatherScatterTaskProcess* m_PEGatherScatterProcess;
\r
52 struct btLowLevelData* m_lowLevelData;
\r
54 void createStateAndCollidable(btRigidBody* body);
\r
56 void syncRigidBodyState(btRigidBody* body);
\r
59 btBulletPhysicsEffectsWorld(struct btLowLevelData* lowLevelData, btDispatcher* dispatcher,btLowLevelBroadphase* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration, btThreadSupportInterface* threadSupport);
\r
61 virtual ~btBulletPhysicsEffectsWorld();
\r
63 virtual void predictUnconstraintMotion(btScalar timeStep);
\r
65 virtual void integrateTransforms(btScalar timeStep);
\r
67 virtual void solveConstraints(btContactSolverInfo& solverInfo);
\r
69 virtual void calculateSimulationIslands();
\r
71 virtual void addRigidBody(btRigidBody* body);
\r
73 virtual void addRigidBody(btRigidBody* body, short group, short mask);
\r
75 virtual void removeRigidBody(btRigidBody* body);
\r
79 #endif //_BT_PARALLEL_DYNAMICS_WORLD_H