mirror of
https://github.com/bloeys/physx-go.git
synced 2025-12-29 07:58:20 +00:00
Rigiddynamic CMass+Shape local poses
This commit is contained in:
Binary file not shown.
10
pgo/pgo.go
10
pgo/pgo.go
@ -157,6 +157,16 @@ type Shape struct {
|
||||
cShape C.struct_CPxShape
|
||||
}
|
||||
|
||||
func (s *Shape) GetLocalPose() *Transform {
|
||||
return &Transform{
|
||||
cT: C.CPxShape_getLocalPose(&s.cShape),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Shape) SetLocalPose(tr *Transform) {
|
||||
C.CPxShape_setLocalPose(&s.cShape, &tr.cT)
|
||||
}
|
||||
|
||||
func CreateExclusiveShape(rigidActor RigidActor, geom *Geometry, mat *Material, shapeFlags ShapeFlags) Shape {
|
||||
return Shape{
|
||||
cShape: C.createExclusiveShape(rigidActor.cRa, geom.cG, mat.cM, uint32(shapeFlags)),
|
||||
|
||||
@ -47,6 +47,9 @@ extern "C" {
|
||||
CPxAPI CSTRUCT CPxTransform CPxRigidDynamic_getGlobalPose(CSTRUCT CPxRigidDynamic* crd);
|
||||
CPxAPI void CPxRigidDynamic_setGlobalPose(CSTRUCT CPxRigidDynamic* crd, CSTRUCT CPxTransform* tr, bool autoAwake);
|
||||
|
||||
CPxAPI CSTRUCT CPxTransform CPxRigidDynamic_getCMassLocalPose(CSTRUCT CPxRigidDynamic* crd);
|
||||
CPxAPI void CPxRigidDynamic_setCMassLocalPose(CSTRUCT CPxRigidDynamic* crd, CSTRUCT CPxTransform* tr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
#ifndef CPxShape_H
|
||||
#define CPxShape_H
|
||||
|
||||
#include "CPxTransform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -10,6 +12,9 @@ extern "C" {
|
||||
void* obj;
|
||||
};
|
||||
|
||||
CPxAPI void CPxShape_setLocalPose(CSTRUCT CPxShape* cs, CSTRUCT CPxTransform* tr);
|
||||
CPxAPI CSTRUCT CPxTransform CPxShape_getLocalPose(CSTRUCT CPxShape* cs);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -95,6 +95,16 @@ func (rd *RigidDynamic) SetGlobalPose(tr *Transform, autoAwake bool) {
|
||||
C.CPxRigidDynamic_setGlobalPose(rd.cRd, &tr.cT, C._Bool(autoAwake))
|
||||
}
|
||||
|
||||
func (rd *RigidDynamic) GetCMassLocalPose() *Transform {
|
||||
return &Transform{
|
||||
cT: C.CPxRigidDynamic_getCMassLocalPose(rd.cRd),
|
||||
}
|
||||
}
|
||||
|
||||
func (rd *RigidDynamic) SetCMassLocalPose(tr *Transform) {
|
||||
C.CPxRigidDynamic_setCMassLocalPose(rd.cRd, &tr.cT)
|
||||
}
|
||||
|
||||
func (rd *RigidDynamic) ToActor() Actor {
|
||||
return Actor{
|
||||
cA: C.CPxRigidDynamic_toCPxActor(rd.cRd),
|
||||
|
||||
Reference in New Issue
Block a user