mirror of
https://github.com/bloeys/physx-go.git
synced 2025-12-29 07:58:20 +00:00
Capsule geometry
This commit is contained in:
Binary file not shown.
16
pgo/pgo.go
16
pgo/pgo.go
@ -272,6 +272,22 @@ func NewBoxGeometry(hx, hy, hz float32) *BoxGeometry {
|
||||
}
|
||||
}
|
||||
|
||||
type CapsuleGeometry struct {
|
||||
cCg C.struct_CPxCapsuleGeometry
|
||||
}
|
||||
|
||||
func (bg *CapsuleGeometry) ToGeometry() *Geometry {
|
||||
return &Geometry{
|
||||
cG: C.CPxCapsuleGeometry_toCPxGeometry(&bg.cCg),
|
||||
}
|
||||
}
|
||||
|
||||
func NewCapsuleGeometry(radius, halfHeight float32) *CapsuleGeometry {
|
||||
return &CapsuleGeometry{
|
||||
cCg: C.NewCPxCapsuleGeometry(C.float(radius), C.float(halfHeight)),
|
||||
}
|
||||
}
|
||||
|
||||
type Actor struct {
|
||||
cA C.struct_CPxActor
|
||||
}
|
||||
|
||||
19
pgo/physx-c/CPxCapsuleGeometry.h
Executable file
19
pgo/physx-c/CPxCapsuleGeometry.h
Executable file
@ -0,0 +1,19 @@
|
||||
#ifndef CPxCapsuleGeometry_H
|
||||
#define CPxCapsuleGeometry_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct CPxCapsuleGeometry
|
||||
{
|
||||
CPxReal radius, halfHeight;
|
||||
};
|
||||
|
||||
CPxAPI CPxInline CSTRUCT CPxCapsuleGeometry NewCPxCapsuleGeometry(CPxReal radius, CPxReal halfHeight);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !CPxCapsuleGeometry_H
|
||||
@ -3,6 +3,7 @@
|
||||
|
||||
#include "CPxBoxGeometry.h"
|
||||
#include "CPxSphereGeometry.h"
|
||||
#include "CPxCapsuleGeometry.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -27,12 +28,14 @@ extern "C" {
|
||||
CENUM CPxGeometryType type;
|
||||
};
|
||||
|
||||
CPxAPI CPxInline CSTRUCT CPxSphereGeometry CPxGeometry_toCPxSphere(CSTRUCT CPxGeometry);
|
||||
CPxAPI CPxInline CSTRUCT CPxSphereGeometry CPxGeometry_toCPxSphereGeometry(CSTRUCT CPxGeometry);
|
||||
CPxAPI CPxInline CSTRUCT CPxGeometry CPxSphereGeometry_toCPxGeometry(CSTRUCT CPxSphereGeometry*);
|
||||
|
||||
CPxAPI CPxInline CSTRUCT CPxBoxGeometry CPxGeometry_toCPxBox(CSTRUCT CPxGeometry);
|
||||
CPxAPI CPxInline CSTRUCT CPxBoxGeometry CPxGeometry_toCPxBoxGeometry(CSTRUCT CPxGeometry);
|
||||
CPxAPI CPxInline CSTRUCT CPxGeometry CPxBoxGeometry_toCPxGeometry(CSTRUCT CPxBoxGeometry*);
|
||||
|
||||
CPxAPI CPxInline CSTRUCT CPxCapsuleGeometry CPxGeometry_toCPxCapsuleGeometry(CSTRUCT CPxGeometry);
|
||||
CPxAPI CPxInline CSTRUCT CPxGeometry CPxCapsuleGeometry_toCPxGeometry(CSTRUCT CPxCapsuleGeometry*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -25,4 +25,5 @@
|
||||
#include <CExtSimpleFactory.h>
|
||||
#include <CPxGeometry.h>
|
||||
#include <CPxBoxGeometry.h>
|
||||
#include <CPxSphereGeometry.h>
|
||||
#include <CPxSphereGeometry.h>
|
||||
#include <CPxCapsuleGeometry.h>
|
||||
Reference in New Issue
Block a user