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:
erwin.coumans
2012-03-05 04:59:58 +00:00
parent 6cf8dfc202
commit a93a661b94
462 changed files with 86626 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
/*
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_BATCHED_RAY_CAST_H
#define _SCE_PFX_BATCHED_RAY_CAST_H
#include "../../base_level/rigidbody/pfx_rigid_state.h"
#include "../../base_level/collision/pfx_collidable.h"
#include "../../base_level/broadphase/pfx_broadphase_proxy.h"
#include "../task/pfx_task_manager.h"
#include "pfx_ray_cast.h"
///////////////////////////////////////////////////////////////////////////////
// Batched RayCast
namespace sce {
namespace PhysicsEffects {
void pfxCastRays(PfxRayInput *rayInputs,PfxRayOutput *rayOutputs,int numRays,PfxRayCastParam &param);
void pfxCastRays(PfxRayInput *rayInputs,PfxRayOutput *rayOutputs,int numRays,PfxRayCastParam &param,PfxTaskManager *taskManager);
} //namespace PhysicsEffects
} //namespace sce
#endif // _SCE_PFX_BATCHED_RAY_CAST_H

View File

@@ -0,0 +1,48 @@
/*
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_COLLISION_DETECTION_H_
#define _SCE_PFX_COLLISION_DETECTION_H_
#include "../../base_level/rigidbody/pfx_rigid_state.h"
#include "../../base_level/collision/pfx_collidable.h"
#include "../../base_level/collision/pfx_contact_manifold.h"
#include "../../base_level/solver/pfx_constraint_pair.h"
#include "../task/pfx_task_manager.h"
namespace sce {
namespace PhysicsEffects {
///////////////////////////////////////////////////////////////////////////////
// Detect Collision
struct PfxDetectCollisionParam {
PfxConstraintPair *contactPairs;
PfxUInt32 numContactPairs;
PfxContactManifold *offsetContactManifolds;
PfxRigidState *offsetRigidStates;
PfxCollidable *offsetCollidables;
PfxUInt32 numRigidBodies;
};
PfxInt32 pfxDetectCollision(PfxDetectCollisionParam &param);
PfxInt32 pfxDetectCollision(PfxDetectCollisionParam &param,PfxTaskManager *taskManager);
} //namespace PhysicsEffects
} //namespace sce
#endif /* _SCE_PFX_COLLISION_DETECTION_H_ */

View File

@@ -0,0 +1,78 @@
/*
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_ISLAND_GENERATION_H_
#define _SCE_PFX_ISLAND_GENERATION_H_
#include "../../base_level/solver/pfx_constraint_pair.h"
#include "../task/pfx_task_manager.h"
namespace sce {
namespace PhysicsEffects {
///////////////////////////////////////////////////////////////////////////////
// Island Generation
struct PfxIsland;
struct PfxIslandUnit;
struct PfxGenerateIslandParam {
void *islandBuff;
PfxUInt32 islandBytes;
PfxConstraintPair *pairs;
PfxUInt32 numPairs;
PfxUInt32 numObjects;
};
struct PfxGenerateIslandResult {
PfxIsland *island;
};
//J アイランド情報を使い終わるまでislandBuffを破棄しないでください
//E Keep islandBuff while the island is used
PfxUInt32 pfxGetIslandBytesOfGenerateIsland(PfxUInt32 numObjects);
PfxInt32 pfxGenerateIsland(PfxGenerateIslandParam &param,PfxGenerateIslandResult &result);
//E Access to island information
//J アイランド情報へのアクセス
//E Get the number of islands
//J アイランド数を取得する
PfxUInt32 pfxGetNumIslands(const PfxIsland *islands);
//E Get a island unit in a island
//J 指定したアイランドに含まれるユニット(剛体)にアクセス
PfxIslandUnit *pfxGetFirstUnitInIsland(const PfxIsland *islands,PfxUInt32 islandId);
PfxIslandUnit *pfxGetNextUnitInIsland(const PfxIslandUnit *islandUnit);
PfxUInt32 pfxGetUnitId(const PfxIslandUnit *islandUnit);
//E Get an index of an island which includes a specific unit
//J 指定したユニット(剛体)のアイランドインデックスを取得する
PfxUInt32 pfxGetIslandId(const PfxIsland *islands,PfxUInt32 unitId);
//E Add pairs and construct islands
//J アイランドにペアを追加する
PfxInt32 pfxAppendPairs(PfxIsland *island,PfxConstraintPair *pairs,PfxUInt32 numPairs);
//E Reset islands
//J アイランドリセット
void pfxResetIsland(PfxIsland *island);
} //namespace PhysicsEffects
} //namespace sce
#endif /* _SCE_PFX_ISLAND_GENERATION_H_ */

View File

@@ -0,0 +1,50 @@
/*
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_RAY_CAST_H
#define _SCE_PFX_RAY_CAST_H
#include "../../base_level/rigidbody/pfx_rigid_state.h"
#include "../../base_level/collision/pfx_collidable.h"
#include "../../base_level/collision/pfx_ray.h"
#include "../../base_level/broadphase/pfx_broadphase_proxy.h"
///////////////////////////////////////////////////////////////////////////////
// RayCast
namespace sce {
namespace PhysicsEffects {
struct PfxRayCastParam {
PfxRigidState *offsetRigidStates;
PfxCollidable *offsetCollidables;
PfxBroadphaseProxy *proxiesX;
PfxBroadphaseProxy *proxiesY;
PfxBroadphaseProxy *proxiesZ;
PfxBroadphaseProxy *proxiesXb;
PfxBroadphaseProxy *proxiesYb;
PfxBroadphaseProxy *proxiesZb;
PfxUInt32 numProxies;
SCE_PFX_PADDING(1,12)
PfxVector3 rangeCenter;
PfxVector3 rangeExtent;
};
void pfxCastSingleRay(const PfxRayInput &rayInput,PfxRayOutput &rayOutput,const PfxRayCastParam &param);
} //namespace PhysicsEffects
} //namespace sce
#endif // _SCE_PFX_RAY_CAST_H

View File

@@ -0,0 +1,46 @@
/*
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_REFRESH_CONTACTS_H
#define _SCE_PFX_REFRESH_CONTACTS_H
#include "../../base_level/rigidbody/pfx_rigid_state.h"
#include "../../base_level/solver/pfx_constraint_pair.h"
#include "../../base_level/collision/pfx_contact_manifold.h"
#include "../task/pfx_task_manager.h"
namespace sce {
namespace PhysicsEffects {
///////////////////////////////////////////////////////////////////////////////
// Refresh Contacts
struct PfxRefreshContactsParam {
PfxConstraintPair *contactPairs;
PfxUInt32 numContactPairs;
PfxContactManifold *offsetContactManifolds;
PfxRigidState *offsetRigidStates;
PfxUInt32 numRigidBodies;
};
PfxInt32 pfxRefreshContacts(PfxRefreshContactsParam &param);
PfxInt32 pfxRefreshContacts(PfxRefreshContactsParam &param,PfxTaskManager *taskManager);
} //namespace PhysicsEffects
} //namespace sce
#endif // _SCE_PFX_REFRESH_CONTACTS_H