diff --git a/pgo/libs/libphysxc_checked_windows_amd64.a b/pgo/libs/libphysxc_checked_windows_amd64.a index 257a945..c2d0e9e 100755 Binary files a/pgo/libs/libphysxc_checked_windows_amd64.a and b/pgo/libs/libphysxc_checked_windows_amd64.a differ diff --git a/pgo/libs/libphysxc_release_windows_amd64.a b/pgo/libs/libphysxc_release_windows_amd64.a index 257a945..c2d0e9e 100755 Binary files a/pgo/libs/libphysxc_release_windows_amd64.a and b/pgo/libs/libphysxc_release_windows_amd64.a differ diff --git a/pgo/pgo.go b/pgo/pgo.go index 89de82d..4f314f1 100755 --- a/pgo/pgo.go +++ b/pgo/pgo.go @@ -544,7 +544,6 @@ type Quat struct { cQ C.struct_CPxQuat } -// CPxAPI CPxInline CSTRUCT CPxQuat NewCPxQuat(float angleRads, float x, float y, float z); func NewQuat(angleRads, x, y, z float32) *Quat { return &Quat{ cQ: C.NewCPxQuat(C.float(angleRads), C.float(x), C.float(y), C.float(z)), @@ -668,7 +667,15 @@ func (ra *RigidActor) SetSimFilterData(fd *FilterData) { C.CPxRigidActor_setSimFilterData(ra.cRa, fd.cFilterData) } -// CPxAPI void CPxRigidActor_setSimFilterData(CSTRUCT CPxRigidActor* cra, CSTRUCT CPxFilterData* cfd); +// SetUserData sets the void* field on the rigid actor which can be used for any purpose. +// For example, it can be used to store an id or pointer that ties this rigid actor to some other object +func (ra *RigidActor) SetUserData(userData unsafe.Pointer) { + C.CPxRigidActor_set_userData(ra.cRa, userData) +} + +func (ra *RigidActor) GetUserData() unsafe.Pointer { + return C.CPxRigidActor_get_userData(ra.cRa) +} type RigidStatic struct { cRs C.struct_CPxRigidStatic diff --git a/pgo/physx-c/CPxRigidActor.h b/pgo/physx-c/CPxRigidActor.h index c7bb1bd..52a63be 100755 --- a/pgo/physx-c/CPxRigidActor.h +++ b/pgo/physx-c/CPxRigidActor.h @@ -4,16 +4,19 @@ #include "CPxFilterData.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif struct CPxRigidActor { - void* obj; + void *obj; }; - //Sets the CPxFilterData on all the shapes of the actor. + // Sets the CPxFilterData on all the shapes of the actor. CPxAPI void CPxRigidActor_setSimFilterData(CSTRUCT CPxRigidActor cra, CSTRUCT CPxFilterData cfd); + CPxAPI void CPxRigidActor_set_userData(CSTRUCT CPxRigidActor cra, void *userData); + CPxAPI void *CPxRigidActor_get_userData(CSTRUCT CPxRigidActor cra); #ifdef __cplusplus }