From eb4519cc5354a9f7bd3edc74a866c2d20a7a0d6a Mon Sep 17 00:00:00 2001 From: bloeys Date: Fri, 28 Jan 2022 09:05:48 +0400 Subject: [PATCH] Shapes+RigidActors+CreateExclusiveShape+add createRigid dynamic/static to physics --- main.go | 6 ++++ pgo/libs/libphysx-c.a | Bin 18346 -> 19664 bytes pgo/pgo.go | 45 ++++++++++++++++++++--- pgo/physx-c/CPxPhysics.h | 6 ++++ pgo/physx-c/CPxRigidActor.h | 17 +++++++++ pgo/physx-c/CPxRigidActorExt.h | 20 +++++++++++ pgo/physx-c/CPxRigidDynamic.h | 5 ++- pgo/physx-c/CPxRigidStatic.h | 6 ++-- pgo/physx-c/CPxShape.h | 17 +++++++++ pgo/physx-c/CPxShapeFlags.h | 63 +++++++++++++++++++++++++++++++++ pgo/physx-c/CPxSimpleFactory.h | 19 ++++++++++ pgo/rigiddynamic.go | 10 ++++-- pgo/shaperflags.go | 53 +++++++++++++++++++++++++++ pgo/wrap.c | 9 ++++- 14 files changed, 263 insertions(+), 13 deletions(-) create mode 100755 pgo/physx-c/CPxRigidActor.h create mode 100755 pgo/physx-c/CPxRigidActorExt.h create mode 100755 pgo/physx-c/CPxShape.h create mode 100755 pgo/physx-c/CPxShapeFlags.h create mode 100755 pgo/physx-c/CPxSimpleFactory.h create mode 100755 pgo/shaperflags.go diff --git a/main.go b/main.go index 665d0b6..11218d7 100755 --- a/main.go +++ b/main.go @@ -67,6 +67,12 @@ func main() { dynCapsule := pgo.CreateDynamic(p, tr4, pgo.NewCapsuleGeometry(0.25, 0.5).ToGeometry(), pMat, 1, shapeOffset) s.AddActor(dynCapsule.ToActor()) + //Add compound shape + dynComp := p.CreateRigidDynamic(pgo.NewTransform(pgo.NewVec3(0, 35, 0), qID)) + pgo.CreateExclusiveShape(dynComp.ToRigidActor(), pgo.NewSphereGeometry(2).ToGeometry(), pMat, pgo.ShapeFlags_eSCENE_QUERY_SHAPE|pgo.ShapeFlags_eSIMULATION_SHAPE|pgo.ShapeFlags_eVISUALIZATION) + pgo.CreateExclusiveShape(dynComp.ToRigidActor(), pgo.NewBoxGeometry(10, 0.1, 0.1).ToGeometry(), pMat, pgo.ShapeFlags_eSCENE_QUERY_SHAPE|pgo.ShapeFlags_eSIMULATION_SHAPE|pgo.ShapeFlags_eVISUALIZATION) + s.AddActor(dynComp.ToActor()) + dynSphere.SetMass(1) dynCapsule.SetMass(1) println("Box 1 mass:", dynBox.GetMass()) diff --git a/pgo/libs/libphysx-c.a b/pgo/libs/libphysx-c.a index 885b9f8aa494bec706302b2fe372fb3e4ead8fcc..2c6768c8c3f98636c6a1b9315c6de28611249b9a 100755 GIT binary patch delta 2784 zcmc(he@t7~7015>Ot~0Hzzzl+z=R*+H#XQ{8?cQrhCtSs5VRj+80I)BgdYizEa|qG zYTZ91>JLu4G;RJ!SCw{EDy2c|s;rZ?s!5x)pd`!4GG&2KMM_IDO%eSF_J_x!l;zH{z-Z#*4!{z%j_wvg3qHH3dX@c^C&3i^S<=YXPfKpCqfC3y-h zSwNUWJTj#d3Kd5Ii7`!~Vm-@@$)Hd+#BrF?1cgc-B_)#~`Nu{Pn$3Wuk^@VsVihd! z1Co{%1uN?%H7_cZzXM3BDZr4*v=!fDb&q>jKig1?*b(CtqOIV zRMJqY;NqZ?Ig`W2c_@D4MLFNE0vkCqLXR=Yy^ zCf-V>l@mzX(iAMbK#6&~Le(vPG?Kjv<^|R>W!DtiIBA%>Jl>@!y=D5Bs~)H(b7PAF zBf;LWVAH<9z@E{*y}^#hdUpl!O-hPVYiT}CO>rW1`f8kB6~Co#N8h%Fz}WBz^{REW zIsGBk^~82n*n+xq43Vp}q{it`(oz(CCn=BI-nG;d8%sZ1^Q1a#*fG{S))%1UgkzG9j!JADo@qXo0-YO9jRW!>Y&Qe9_-^(x3w(Wz?|Opg?lRBwMyap{ zNr*!X6444bIW=oTEog=p8_|Td$bcT}kOm#9P>E6)v7R^Agko$!9&%BR98{nLMJPl8 z@?n7)HK>LYF4Vz}dRSpYEmGh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scene) GetScenePvdClient() *PvdSceneClient { } } -func (s *Scene) AddActor(a *Actor) { +func (s *Scene) AddActor(a Actor) { C.CPxScene_addActor(s.cS, a.cA) } @@ -126,6 +126,25 @@ func (p *Physics) CreateMaterial(staticFriction, dynamicFriction, restitution fl } } +// CPxAPI CSTRUCT CPxRigidDynamic* CPxPhysics_createRigidDynamic(CSTRUCT CPxPhysics* cp, CSTRUCT CPxTransform* ctr); +// CPxAPI CSTRUCT CPxRigidStatic* CPxPhysics_createRigidStatic(CSTRUCT CPxPhysics* cp, CSTRUCT CPxTransform* ctr); + +func (p *Physics) CreateRigidDynamic(tr *Transform) *RigidDynamic { + return &RigidDynamic{ + cRd: C.CPxPhysics_createRigidDynamic(p.cPhysics, &tr.cT), + } +} + +func (p *Physics) CreateRigidStatic(tr *Transform) *RigidStatic { + return &RigidStatic{ + cRs: C.CPxPhysics_createRigidStatic(p.cPhysics, &tr.cT), + } +} + +func (p *Physics) Release() { + C.CPxPhysics_release(p.cPhysics) +} + func CreatePhysics(f *Foundation, ts *TolerancesScale, trackOutstandingAllocations bool, pvd *Pvd) *Physics { p := &Physics{} @@ -134,8 +153,14 @@ func CreatePhysics(f *Foundation, ts *TolerancesScale, trackOutstandingAllocatio return p } -func (p *Physics) Release() { - C.CPxPhysics_release(p.cPhysics) +type Shape struct { + cShape C.struct_CPxShape +} + +func CreateExclusiveShape(rigidActor RigidActor, geom *Geometry, mat *Material, shapeFlags ShapeFlags) Shape { + return Shape{ + cShape: C.createExclusiveShape(rigidActor.cRa, geom.cG, mat.cM, uint32(shapeFlags)), + } } type Vec3 struct { @@ -306,16 +331,26 @@ type Actor struct { cA C.struct_CPxActor } +type RigidActor struct { + cRa C.struct_CPxRigidActor +} + type RigidStatic struct { cRs *C.struct_CPxRigidStatic } -func (rs *RigidStatic) ToActor() *Actor { - return &Actor{ +func (rs *RigidStatic) ToActor() Actor { + return Actor{ cA: C.CPxRigidStatic_toCPxActor(rs.cRs), } } +func (rs *RigidStatic) ToRigidActor() RigidActor { + return RigidActor{ + cRa: C.CPxRigidStatic_toCPxRigidActor(rs.cRs), + } +} + func CreatePlane(p *Physics, plane *Plane, mat *Material) *RigidStatic { return &RigidStatic{ cRs: C.CPxCreatePlane(p.cPhysics, plane.cP, mat.cM), diff --git a/pgo/physx-c/CPxPhysics.h b/pgo/physx-c/CPxPhysics.h index d2c4b80..38dc155 100755 --- a/pgo/physx-c/CPxPhysics.h +++ b/pgo/physx-c/CPxPhysics.h @@ -7,6 +7,9 @@ #include "CPxSceneDesc.h" #include "CPxMaterial.h" #include "CPxTolerancesScale.h" +#include "CPxRigidStatic.h" +#include "CPxRigidDynamic.h" +#include "CPxTransform.h" #ifdef __cplusplus extern "C" { @@ -19,6 +22,9 @@ extern "C" { CPxAPI CSTRUCT CPxPhysics* CPxCreatePhysics(CSTRUCT CPxFoundation* cfoundation, CSTRUCT CPxTolerancesScale cscale, bool trackOutstandingAllocations, CSTRUCT CPxPvd* cpvd); CPxAPI CSTRUCT CPxScene* CPxPhysics_createScene(CSTRUCT CPxPhysics*, CSTRUCT CPxSceneDesc*); CPxAPI CSTRUCT CPxMaterial* CPxPhysics_createMaterial(CSTRUCT CPxPhysics*, CPxReal staticFriction, CPxReal dynamicFriction, CPxReal restitution); + CPxAPI CSTRUCT CPxRigidDynamic* CPxPhysics_createRigidDynamic(CSTRUCT CPxPhysics* cp, CSTRUCT CPxTransform* ctr); + CPxAPI CSTRUCT CPxRigidStatic* CPxPhysics_createRigidStatic(CSTRUCT CPxPhysics* cp, CSTRUCT CPxTransform* ctr); + CPxAPI void CPxPhysics_release(CSTRUCT CPxPhysics*); #ifdef __cplusplus diff --git a/pgo/physx-c/CPxRigidActor.h b/pgo/physx-c/CPxRigidActor.h new file mode 100755 index 0000000..86cbbb6 --- /dev/null +++ b/pgo/physx-c/CPxRigidActor.h @@ -0,0 +1,17 @@ +#ifndef CPxRigidActor_H +#define CPxRigidActor_H + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxRigidActor + { + void* obj; + }; + +#ifdef __cplusplus +} +#endif + +#endif // !CPxRigidActor_H diff --git a/pgo/physx-c/CPxRigidActorExt.h b/pgo/physx-c/CPxRigidActorExt.h new file mode 100755 index 0000000..ac61a6b --- /dev/null +++ b/pgo/physx-c/CPxRigidActorExt.h @@ -0,0 +1,20 @@ +#ifndef CPxRigidActorExt_H +#define CPxRigidActorExt_H + +#include "CPxRigidActor.h" +#include "CPxShape.h" +#include "CPxGeometry.h" +#include "CPxMaterial.h" +#include "CPxShapeFlags.h" + +#ifdef __cplusplus +extern "C" { +#endif + + CPxAPI CSTRUCT CPxShape createExclusiveShape(CSTRUCT CPxRigidActor actor, CSTRUCT CPxGeometry geometry, CSTRUCT CPxMaterial* material, CENUM CPxShapeFlags shapeFlags); + +#ifdef __cplusplus +} +#endif + +#endif // !CPxRigidActorExt_H diff --git a/pgo/physx-c/CPxRigidDynamic.h b/pgo/physx-c/CPxRigidDynamic.h index 16ff161..d822680 100755 --- a/pgo/physx-c/CPxRigidDynamic.h +++ b/pgo/physx-c/CPxRigidDynamic.h @@ -2,6 +2,7 @@ #define CPxRigidDynamic_H #include "CPxActor.h" +#include "CPxRigidActor.h" #include "CPxVec3.h" #include "CPxTransform.h" #include "CPxForceMode.h" @@ -18,6 +19,8 @@ extern "C" { }; CPxAPI CSTRUCT CPxActor CPxRigidDynamic_toCPxActor(CSTRUCT CPxRigidDynamic*); + CPxAPI CSTRUCT CPxRigidActor CPxRigidDynamic_toCPxRigidActor(CSTRUCT CPxRigidDynamic*); + CPxAPI void CPxRigidDynamic_addForce(CSTRUCT CPxRigidDynamic* crd, CSTRUCT CPxVec3* force, CENUM CPxForceMode fmode, bool autoAwake); CPxAPI void CPxRigidDynamic_addTorque(CSTRUCT CPxRigidDynamic* crd, CSTRUCT CPxVec3* torque, CENUM CPxForceMode fmode, bool autoAwake); @@ -25,7 +28,7 @@ extern "C" { CPxAPI void CPxRigidDynamic_setAngularDamping(CSTRUCT CPxRigidDynamic* crd, CPxReal damping); CPxAPI CPxReal CPxRigidDynamic_getLinearDamping(CSTRUCT CPxRigidDynamic* crd); CPxAPI CPxReal CPxRigidDynamic_getAngularDamping(CSTRUCT CPxRigidDynamic* crd); - + CPxAPI CSTRUCT CPxVec3 CPxRigidDynamic_getLinearVelocity(CSTRUCT CPxRigidDynamic* crd); CPxAPI CSTRUCT CPxVec3 CPxRigidDynamic_getAngularVelocity(CSTRUCT CPxRigidDynamic* crd); diff --git a/pgo/physx-c/CPxRigidStatic.h b/pgo/physx-c/CPxRigidStatic.h index 248ec9a..b3d594b 100755 --- a/pgo/physx-c/CPxRigidStatic.h +++ b/pgo/physx-c/CPxRigidStatic.h @@ -1,10 +1,8 @@ #ifndef CPxRigidStatic_H #define CPxRigidStatic_H -#include "CPxPhysics.h" -#include "CPxPlane.h" -#include "CPxMaterial.h" #include "CPxActor.h" +#include "CPxRigidActor.h" #ifdef __cplusplus extern "C" { @@ -15,8 +13,8 @@ extern "C" { void* obj; }; - CPxAPI CSTRUCT CPxRigidStatic* CPxCreatePlane(CSTRUCT CPxPhysics* sdk, CSTRUCT CPxPlane* plane, CSTRUCT CPxMaterial* material); CPxAPI CSTRUCT CPxActor CPxRigidStatic_toCPxActor(CSTRUCT CPxRigidStatic*); + CPxAPI CSTRUCT CPxRigidActor CPxRigidStatic_toCPxRigidActor(CSTRUCT CPxRigidStatic*); #ifdef __cplusplus } diff --git a/pgo/physx-c/CPxShape.h b/pgo/physx-c/CPxShape.h new file mode 100755 index 0000000..e91d05a --- /dev/null +++ b/pgo/physx-c/CPxShape.h @@ -0,0 +1,17 @@ +#ifndef CPxShape_H +#define CPxShape_H + +#ifdef __cplusplus +extern "C" { +#endif + + struct CPxShape + { + void* obj; + }; + +#ifdef __cplusplus +} +#endif + +#endif // !CPxShape_H diff --git a/pgo/physx-c/CPxShapeFlags.h b/pgo/physx-c/CPxShapeFlags.h new file mode 100755 index 0000000..77e5629 --- /dev/null +++ b/pgo/physx-c/CPxShapeFlags.h @@ -0,0 +1,63 @@ +#ifndef CPxShapeFlags_H +#define CPxShapeFlags_H + +#ifdef __cplusplus +extern "C" { +#endif + + enum CPxShapeFlags + { + /** + \brief The shape will partake in collision in the physical simulation. + + \note It is illegal to raise the eSIMULATION_SHAPE and eTRIGGER_SHAPE flags. + In the event that one of these flags is already raised the sdk will reject any + attempt to raise the other. To raise the eSIMULATION_SHAPE first ensure that + eTRIGGER_SHAPE is already lowered. + + \note This flag has no effect if simulation is disabled for the corresponding actor (see #PxActorFlag::eDISABLE_SIMULATION). + + @see PxSimulationEventCallback.onContact() PxScene.setSimulationEventCallback() PxShape.setFlag(), PxShape.setFlags() + */ + CPxShapeFlags_eSIMULATION_SHAPE = (1 << 0), + + /** + \brief The shape will partake in scene queries (ray casts, overlap tests, sweeps, ...). + */ + CPxShapeFlags_eSCENE_QUERY_SHAPE = (1 << 1), + + /** + \brief The shape is a trigger which can send reports whenever other shapes enter/leave its volume. + + \note Triangle meshes and heightfields can not be triggers. Shape creation will fail in these cases. + + \note Shapes marked as triggers do not collide with other objects. If an object should act both + as a trigger shape and a collision shape then create a rigid body with two shapes, one being a + trigger shape and the other a collision shape. It is illegal to raise the eTRIGGER_SHAPE and + eSIMULATION_SHAPE flags on a single PxShape instance. In the event that one of these flags is already + raised the sdk will reject any attempt to raise the other. To raise the eTRIGGER_SHAPE flag first + ensure that eSIMULATION_SHAPE flag is already lowered. + + \note Trigger shapes will no longer send notification events for interactions with other trigger shapes. + + \note Shapes marked as triggers are allowed to participate in scene queries, provided the eSCENE_QUERY_SHAPE flag is set. + + \note This flag has no effect if simulation is disabled for the corresponding actor (see #PxActorFlag::eDISABLE_SIMULATION). + + @see PxSimulationEventCallback.onTrigger() PxScene.setSimulationEventCallback() PxShape.setFlag(), PxShape.setFlags() + */ + CPxShapeFlags_eTRIGGER_SHAPE = (1 << 2), + + /** + \brief Enable debug renderer for this shape + + @see PxScene.getRenderBuffer() PxRenderBuffer PxVisualizationParameter + */ + CPxShapeFlags_eVISUALIZATION = (1 << 3) + }; + +#ifdef __cplusplus +} +#endif + +#endif // !CPxShapeFlags_H diff --git a/pgo/physx-c/CPxSimpleFactory.h b/pgo/physx-c/CPxSimpleFactory.h new file mode 100755 index 0000000..3efd88b --- /dev/null +++ b/pgo/physx-c/CPxSimpleFactory.h @@ -0,0 +1,19 @@ +#ifndef CPxSimpleFactory_H +#define CPxSimpleFactory_H + +#include "CPxPlane.h" +#include "CPxPhysics.h" +#include "CPxMaterial.h" +#include "CPxRigidStatic.h" + +#ifdef __cplusplus +extern "C" { +#endif + + CPxAPI CSTRUCT CPxRigidStatic* CPxCreatePlane(CSTRUCT CPxPhysics* sdk, CSTRUCT CPxPlane* plane, CSTRUCT CPxMaterial* material); + +#ifdef __cplusplus +} +#endif + +#endif // !CPxSimpleFactory_H diff --git a/pgo/rigiddynamic.go b/pgo/rigiddynamic.go index 67400f7..b7b8e14 100755 --- a/pgo/rigiddynamic.go +++ b/pgo/rigiddynamic.go @@ -95,12 +95,18 @@ func (rd *RigidDynamic) SetGlobalPose(tr *Transform, autoAwake bool) { C.CPxRigidDynamic_setGlobalPose(rd.cRd, &tr.cT, C._Bool(autoAwake)) } -func (rd *RigidDynamic) ToActor() *Actor { - return &Actor{ +func (rd *RigidDynamic) ToActor() Actor { + return Actor{ cA: C.CPxRigidDynamic_toCPxActor(rd.cRd), } } +func (rd *RigidDynamic) ToRigidActor() RigidActor { + return RigidActor{ + cRa: C.CPxRigidDynamic_toCPxRigidActor(rd.cRd), + } +} + func CreateDynamic(p *Physics, t *Transform, g *Geometry, m *Material, density float32, shapeOffset *Transform) *RigidDynamic { return &RigidDynamic{ cRd: C.CPxCreateDynamic(p.cPhysics, &t.cT, g.cG, m.cM, C.float(density), &shapeOffset.cT), diff --git a/pgo/shaperflags.go b/pgo/shaperflags.go new file mode 100755 index 0000000..c9625af --- /dev/null +++ b/pgo/shaperflags.go @@ -0,0 +1,53 @@ +package pgo + +type ShapeFlags uint32 + +const ( + /** + \brief The shape will partake in collision in the physical simulation. + + \note It is illegal to raise the eSIMULATION_SHAPE and eTRIGGER_SHAPE flags. + In the event that one of these flags is already raised the sdk will reject any + attempt to raise the other. To raise the eSIMULATION_SHAPE first ensure that + eTRIGGER_SHAPE is already lowered. + + \note This flag has no effect if simulation is disabled for the corresponding actor (see #PxActorFlag::eDISABLE_SIMULATION). + + @see PxSimulationEventCallback.onContact() PxScene.setSimulationEventCallback() PxShape.setFlag(), PxShape.setFlags() + */ + ShapeFlags_eSIMULATION_SHAPE ShapeFlags = (1 << 0) + + /** + \brief The shape will partake in scene queries (ray casts, overlap tests, sweeps, ...). + */ + ShapeFlags_eSCENE_QUERY_SHAPE ShapeFlags = (1 << 1) + + /** + \brief The shape is a trigger which can send reports whenever other shapes enter/leave its volume. + + \note Triangle meshes and heightfields can not be triggers. Shape creation will fail in these cases. + + \note Shapes marked as triggers do not collide with other objects. If an object should act both + as a trigger shape and a collision shape then create a rigid body with two shapes, one being a + trigger shape and the other a collision shape. It is illegal to raise the eTRIGGER_SHAPE and + eSIMULATION_SHAPE flags on a single PxShape instance. In the event that one of these flags is already + raised the sdk will reject any attempt to raise the other. To raise the eTRIGGER_SHAPE flag first + ensure that eSIMULATION_SHAPE flag is already lowered. + + \note Trigger shapes will no longer send notification events for interactions with other trigger shapes. + + \note Shapes marked as triggers are allowed to participate in scene queries, provided the eSCENE_QUERY_SHAPE flag is set. + + \note This flag has no effect if simulation is disabled for the corresponding actor (see #PxActorFlag::eDISABLE_SIMULATION). + + @see PxSimulationEventCallback.onTrigger() PxScene.setSimulationEventCallback() PxShape.setFlag(), PxShape.setFlags() + */ + ShapeFlags_eTRIGGER_SHAPE ShapeFlags = (1 << 2) + + /** + \brief Enable debug renderer for this shape + + @see PxScene.getRenderBuffer() PxRenderBuffer PxVisualizationParameter + */ + ShapeFlags_eVISUALIZATION ShapeFlags = (1 << 3) +) diff --git a/pgo/wrap.c b/pgo/wrap.c index d3c0492..2f5478e 100755 --- a/pgo/wrap.c +++ b/pgo/wrap.c @@ -19,12 +19,19 @@ #include #include #include + #include #include +#include +#include + #include #include #include + #include #include #include -#include \ No newline at end of file +#include + +#include \ No newline at end of file