Add PhysicsEffects to Extras. The build is only tested on Windows and Android.
The Android/NEON optimized version of Physics Effects is thanks to Graham Rhodes and Anthony Hamilton, See Issue 587
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
Physics Effects Copyright(C) 2010 Sony Computer Entertainment Inc.
|
||||
All rights reserved.
|
||||
|
||||
Physics Effects is open software; you can redistribute it and/or
|
||||
modify it under the terms of the BSD License.
|
||||
|
||||
Physics Effects is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the BSD License for more details.
|
||||
|
||||
A copy of the BSD License is distributed with
|
||||
Physics Effects under the filename: physics_effects_license.txt
|
||||
*/
|
||||
|
||||
#ifndef _SCE_PFX_CONSTRAINT_SOLVER_H
|
||||
#define _SCE_PFX_CONSTRAINT_SOLVER_H
|
||||
|
||||
#include "../../base_level/rigidbody/pfx_rigid_body.h"
|
||||
#include "../../base_level/rigidbody/pfx_rigid_state.h"
|
||||
#include "../../base_level/solver/pfx_solver_body.h"
|
||||
#include "../../base_level/solver/pfx_constraint_pair.h"
|
||||
#include "../../base_level/solver/pfx_joint.h"
|
||||
#include "../../base_level/collision/pfx_contact_manifold.h"
|
||||
|
||||
#include "../task/pfx_task_manager.h"
|
||||
|
||||
namespace sce {
|
||||
namespace PhysicsEffects {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Setup Solver Bodies
|
||||
|
||||
struct PfxSetupSolverBodiesParam {
|
||||
PfxRigidState *states;
|
||||
PfxRigidBody *bodies;
|
||||
PfxSolverBody *solverBodies;
|
||||
PfxUInt32 numRigidBodies;
|
||||
};
|
||||
|
||||
PfxInt32 pfxSetupSolverBodies(PfxSetupSolverBodiesParam ¶m);
|
||||
|
||||
PfxInt32 pfxSetupSolverBodies(PfxSetupSolverBodiesParam ¶m,PfxTaskManager *taskManager);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Setup Constraints
|
||||
|
||||
struct PfxSetupContactConstraintsParam {
|
||||
PfxConstraintPair *contactPairs;
|
||||
PfxUInt32 numContactPairs;
|
||||
PfxContactManifold *offsetContactManifolds;
|
||||
PfxRigidState *offsetRigidStates;
|
||||
PfxRigidBody *offsetRigidBodies;
|
||||
PfxSolverBody *offsetSolverBodies;
|
||||
PfxUInt32 numRigidBodies;
|
||||
PfxFloat timeStep;
|
||||
PfxFloat separateBias;
|
||||
|
||||
PfxSetupContactConstraintsParam()
|
||||
{
|
||||
timeStep = 0.016f;
|
||||
separateBias = 0.2f;
|
||||
}
|
||||
};
|
||||
|
||||
PfxInt32 pfxSetupContactConstraints(PfxSetupContactConstraintsParam ¶m);
|
||||
|
||||
PfxInt32 pfxSetupContactConstraints(PfxSetupContactConstraintsParam ¶m,PfxTaskManager *taskManager);
|
||||
|
||||
struct PfxSetupJointConstraintsParam {
|
||||
PfxConstraintPair *jointPairs;
|
||||
PfxUInt32 numJointPairs;
|
||||
PfxJoint *offsetJoints;
|
||||
PfxRigidState *offsetRigidStates;
|
||||
PfxRigidBody *offsetRigidBodies;
|
||||
PfxSolverBody *offsetSolverBodies;
|
||||
PfxUInt32 numRigidBodies;
|
||||
PfxFloat timeStep;
|
||||
|
||||
PfxSetupJointConstraintsParam()
|
||||
{
|
||||
timeStep = 0.016f;
|
||||
}
|
||||
};
|
||||
|
||||
PfxInt32 pfxSetupJointConstraints(PfxSetupJointConstraintsParam ¶m);
|
||||
|
||||
PfxInt32 pfxSetupJointConstraints(PfxSetupJointConstraintsParam ¶m,PfxTaskManager *taskManager);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Solve Constraints
|
||||
|
||||
struct PfxSolveConstraintsParam {
|
||||
void *workBuff;
|
||||
PfxUInt32 workBytes;
|
||||
PfxConstraintPair *contactPairs;
|
||||
PfxUInt32 numContactPairs;
|
||||
PfxContactManifold *offsetContactManifolds;
|
||||
PfxConstraintPair *jointPairs;
|
||||
PfxUInt32 numJointPairs;
|
||||
PfxJoint *offsetJoints;
|
||||
PfxRigidState *offsetRigidStates;
|
||||
PfxSolverBody *offsetSolverBodies;
|
||||
PfxUInt32 numRigidBodies;
|
||||
PfxUInt32 iteration;
|
||||
|
||||
PfxSolveConstraintsParam()
|
||||
{
|
||||
iteration = 5;
|
||||
}
|
||||
};
|
||||
|
||||
PfxUInt32 pfxGetWorkBytesOfSolveConstraints(PfxUInt32 numRigidBodies,PfxUInt32 numContactPairs,PfxUInt32 numJointPairs,PfxUInt32 maxTasks=1);
|
||||
|
||||
PfxInt32 pfxSolveConstraints(PfxSolveConstraintsParam ¶m);
|
||||
|
||||
PfxInt32 pfxSolveConstraints(PfxSolveConstraintsParam ¶m,PfxTaskManager *taskManager);
|
||||
|
||||
} //namespace PhysicsEffects
|
||||
} //namespace sce
|
||||
#endif // _SCE_PFX_CONSTRAINT_SOLVER_H
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
Physics Effects Copyright(C) 2010 Sony Computer Entertainment Inc.
|
||||
All rights reserved.
|
||||
|
||||
Physics Effects is open software; you can redistribute it and/or
|
||||
modify it under the terms of the BSD License.
|
||||
|
||||
Physics Effects is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the BSD License for more details.
|
||||
|
||||
A copy of the BSD License is distributed with
|
||||
Physics Effects under the filename: physics_effects_license.txt
|
||||
*/
|
||||
|
||||
#ifndef _SCE_PFX_JOINT_CONSTRAINT_FUNC_H_
|
||||
#define _SCE_PFX_JOINT_CONSTRAINT_FUNC_H_
|
||||
|
||||
#include "../../base_level/rigidbody/pfx_rigid_state.h"
|
||||
#include "../../base_level/solver/pfx_solver_body.h"
|
||||
#include "../../base_level/solver/pfx_joint.h"
|
||||
#include "../../base_level/solver/pfx_joint_constraint.h"
|
||||
|
||||
namespace sce {
|
||||
namespace PhysicsEffects {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Setup Joint Constraint Func
|
||||
|
||||
typedef void (*PfxSetupJointConstraintFunc)(
|
||||
PfxJoint &joint,
|
||||
const PfxRigidState &stateA,
|
||||
const PfxRigidState &stateB,
|
||||
PfxSolverBody &solverBodyA,
|
||||
PfxSolverBody &solverBodyB,
|
||||
PfxFloat timeStep);
|
||||
|
||||
PfxSetupJointConstraintFunc pfxGetSetupJointConstraintFunc(PfxUInt8 jointType);
|
||||
|
||||
int pfxSetSetupJointConstraintFunc(PfxUInt8 jointType,PfxSetupJointConstraintFunc func);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Warm Start Joint Constraint Func
|
||||
|
||||
typedef void (*PfxWarmStartJointConstraintFunc)(
|
||||
PfxJoint &joint,
|
||||
PfxSolverBody &solverBodyA,
|
||||
PfxSolverBody &solverBodyB);
|
||||
|
||||
PfxWarmStartJointConstraintFunc pfxGetWarmStartJointConstraintFunc(PfxUInt8 jointType);
|
||||
|
||||
int pfxSetWarmStartJointConstraintFunc(PfxUInt8 jointType,PfxWarmStartJointConstraintFunc func);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Solve Joint Constraint Func
|
||||
|
||||
typedef void (*PfxSolveJointConstraintFunc)(
|
||||
PfxJoint &joint,
|
||||
PfxSolverBody &solverBodyA,
|
||||
PfxSolverBody &solverBodyB);
|
||||
|
||||
PfxSolveJointConstraintFunc pfxGetSolveJointConstraintFunc(PfxUInt8 jointType);
|
||||
|
||||
int pfxSetSolveJointConstraintFunc(PfxUInt8 jointType,PfxSolveJointConstraintFunc func);
|
||||
|
||||
} //namespace PhysicsEffects
|
||||
} //namespace sce
|
||||
|
||||
#endif /* _PFX_JOINT_CONSTRAINT_FUNC_H_ */
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
Physics Effects Copyright(C) 2010 Sony Computer Entertainment Inc.
|
||||
All rights reserved.
|
||||
|
||||
Physics Effects is open software; you can redistribute it and/or
|
||||
modify it under the terms of the BSD License.
|
||||
|
||||
Physics Effects is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the BSD License for more details.
|
||||
|
||||
A copy of the BSD License is distributed with
|
||||
Physics Effects under the filename: physics_effects_license.txt
|
||||
*/
|
||||
|
||||
#ifndef _SCE_PFX_UPDATE_RIGID_STATES_H_
|
||||
#define _SCE_PFX_UPDATE_RIGID_STATES_H_
|
||||
|
||||
#include "../../base_level/rigidbody/pfx_rigid_body.h"
|
||||
#include "../../base_level/rigidbody/pfx_rigid_state.h"
|
||||
|
||||
#include "../task/pfx_task_manager.h"
|
||||
|
||||
namespace sce {
|
||||
namespace PhysicsEffects {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Update Rigid Body States
|
||||
|
||||
struct PfxUpdateRigidStatesParam {
|
||||
PfxRigidState *states;
|
||||
PfxRigidBody *bodies;
|
||||
PfxUInt32 numRigidBodies;
|
||||
PfxFloat timeStep;
|
||||
};
|
||||
|
||||
PfxInt32 pfxUpdateRigidStates(PfxUpdateRigidStatesParam ¶m);
|
||||
|
||||
PfxInt32 pfxUpdateRigidStates(PfxUpdateRigidStatesParam ¶m,PfxTaskManager *taskManager);
|
||||
|
||||
} //namespace PhysicsEffects
|
||||
} //namespace sce
|
||||
|
||||
#endif /* _SCE_PFX_UPDATE_RIGID_STATES_H_ */
|
||||
Reference in New Issue
Block a user