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,60 @@
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//E Mass , Inertia tensor calculation
|
||||
//J 質量・慣性テンソルの算出
|
||||
|
||||
#ifndef _SCE_PFX_MASS_H
|
||||
#define _SCE_PFX_MASS_H
|
||||
|
||||
#include "../base_level/base/pfx_common.h"
|
||||
|
||||
namespace sce {
|
||||
namespace PhysicsEffects {
|
||||
|
||||
// Box
|
||||
PfxFloat pfxCalcMassBox(PfxFloat density,const PfxVector3 &halfExtent);
|
||||
PfxMatrix3 pfxCalcInertiaBox(const PfxVector3 &halfExtent,PfxFloat mass);
|
||||
|
||||
// Sphere
|
||||
PfxFloat pfxCalcMassSphere(PfxFloat density,PfxFloat radius);
|
||||
PfxMatrix3 pfxCalcInertiaSphere(PfxFloat radius,PfxFloat mass);
|
||||
|
||||
// Cylinder
|
||||
PfxFloat pfxCalcMassCylinder(PfxFloat density,PfxFloat halfLength,PfxFloat radius);
|
||||
PfxMatrix3 pfxCalcInertiaCylinderX(PfxFloat halfLength,PfxFloat radius,PfxFloat mass);
|
||||
PfxMatrix3 pfxCalcInertiaCylinderY(PfxFloat halfLength,PfxFloat radius,PfxFloat mass);
|
||||
PfxMatrix3 pfxCalcInertiaCylinderZ(PfxFloat halfLength,PfxFloat radius,PfxFloat mass);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//E Mass convertion
|
||||
//J 質量の移動・回転・合成
|
||||
|
||||
// translation
|
||||
//E returns translated inertia tensor
|
||||
//J 移動後の慣性テンソルを返します
|
||||
PfxMatrix3 pfxMassTranslate(PfxFloat mass,const PfxMatrix3 &inertia,const PfxVector3 &translation);
|
||||
|
||||
// rotation
|
||||
//E returns rotated inertia tensor
|
||||
//J 回転後の慣性テンソルを返します
|
||||
PfxMatrix3 pfxMassRotate(const PfxMatrix3 &inertia,const PfxMatrix3 &rotate);
|
||||
|
||||
} //namespace PhysicsEffects
|
||||
} //namespace sce
|
||||
|
||||
#endif // _SCE_PFX_MASS_H
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
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_MESH_CREATOR_H
|
||||
#define _SCE_PFX_MESH_CREATOR_H
|
||||
|
||||
#include "../base_level/collision/pfx_large_tri_mesh.h"
|
||||
|
||||
namespace sce {
|
||||
namespace PhysicsEffects {
|
||||
|
||||
//J フラグに指定する値
|
||||
//E Specify these values to a flag parameter
|
||||
#define SCE_PFX_MESH_FLAG_NORMAL_FLIP 0x01
|
||||
#define SCE_PFX_MESH_FLAG_16BIT_INDEX 0x02
|
||||
#define SCE_PFX_MESH_FLAG_32BIT_INDEX 0x04
|
||||
#define SCE_PFX_MESH_FLAG_AUTO_ELIMINATION 0x08
|
||||
#define SCE_PFX_MESH_FLAG_AUTO_THICKNESS 0x10
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Convex Mesh
|
||||
|
||||
struct PfxCreateConvexMeshParam {
|
||||
PfxUInt32 flag;
|
||||
PfxFloat *verts;
|
||||
PfxUInt32 numVerts;
|
||||
void *triangles;
|
||||
PfxUInt32 numTriangles;
|
||||
PfxUInt32 vertexStrideBytes;
|
||||
PfxUInt32 triangleStrideBytes;
|
||||
|
||||
PfxCreateConvexMeshParam()
|
||||
{
|
||||
flag = SCE_PFX_MESH_FLAG_16BIT_INDEX|SCE_PFX_MESH_FLAG_AUTO_ELIMINATION;
|
||||
verts = NULL;
|
||||
triangles = NULL;
|
||||
numVerts = 0;
|
||||
numTriangles = 0;
|
||||
vertexStrideBytes = sizeof(PfxFloat)*3;
|
||||
triangleStrideBytes = sizeof(PfxUInt16)*3;
|
||||
}
|
||||
};
|
||||
|
||||
PfxInt32 pfxCreateConvexMesh(PfxConvexMesh &convex,const PfxCreateConvexMeshParam ¶m);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Large Mesh
|
||||
|
||||
struct PfxCreateLargeTriMeshParam {
|
||||
PfxUInt32 flag;
|
||||
PfxFloat *verts;
|
||||
PfxUInt32 numVerts;
|
||||
void *triangles;
|
||||
PfxUInt32 numTriangles;
|
||||
PfxUInt32 vertexStrideBytes;
|
||||
PfxUInt32 triangleStrideBytes;
|
||||
PfxUInt32 numFacetsLimit;
|
||||
PfxFloat islandsRatio;
|
||||
PfxFloat defaultThickness;
|
||||
|
||||
PfxCreateLargeTriMeshParam()
|
||||
{
|
||||
flag = SCE_PFX_MESH_FLAG_16BIT_INDEX|SCE_PFX_MESH_FLAG_AUTO_ELIMINATION;
|
||||
verts = NULL;
|
||||
triangles = NULL;
|
||||
numVerts = 0;
|
||||
numTriangles = 0;
|
||||
vertexStrideBytes = sizeof(PfxFloat)*3;
|
||||
triangleStrideBytes = sizeof(PfxUInt16)*3;
|
||||
numFacetsLimit = 15;
|
||||
islandsRatio = 0.2f;
|
||||
defaultThickness = 0.025f;
|
||||
}
|
||||
};
|
||||
|
||||
PfxInt32 pfxCreateLargeTriMesh(PfxLargeTriMesh &lmesh,const PfxCreateLargeTriMeshParam ¶m);
|
||||
|
||||
void pfxReleaseLargeTriMesh(PfxLargeTriMesh &lmesh);
|
||||
|
||||
} //namespace PhysicsEffects
|
||||
} //namespace sce
|
||||
|
||||
#endif // _SCE_PFX_MESH_CREATOR_H
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
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_UTIL_INCLUDE_H
|
||||
#define _SCE_PFX_UTIL_INCLUDE_H
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Physics Effects Utility Headers
|
||||
|
||||
#include "pfx_mass.h"
|
||||
#include "pfx_mesh_creator.h"
|
||||
|
||||
#endif // _SCE_PFX_UTIL_INCLUDE_H
|
||||
Reference in New Issue
Block a user