mirror of
https://github.com/bloeys/physx-go.git
synced 2025-12-29 07:58:20 +00:00
Fix bug in create dynamic
This commit is contained in:
@ -122,6 +122,13 @@ func (rd *RigidDynamic) ToRigidActor() RigidActor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CreateDynamic(p Physics, t *Transform, g Geometry, m Material, density float32, shapeOffset *Transform) RigidDynamic {
|
func CreateDynamic(p Physics, t *Transform, g Geometry, m Material, density float32, shapeOffset *Transform) RigidDynamic {
|
||||||
|
|
||||||
|
if shapeOffset == nil {
|
||||||
|
return RigidDynamic{
|
||||||
|
cRd: C.CPxCreateDynamic(p.cPhysics, &t.cT, g.cG, m.cM, C.float(density), nil),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return RigidDynamic{
|
return RigidDynamic{
|
||||||
cRd: C.CPxCreateDynamic(p.cPhysics, &t.cT, g.cG, m.cM, C.float(density), &shapeOffset.cT),
|
cRd: C.CPxCreateDynamic(p.cPhysics, &t.cT, g.cG, m.cM, C.float(density), &shapeOffset.cT),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user