mirror of
https://github.com/bloeys/physx-go.git
synced 2025-12-29 07:58:20 +00:00
CPxPlane as value type
This commit is contained in:
Binary file not shown.
@ -511,10 +511,11 @@ type Material struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Plane struct {
|
type Plane struct {
|
||||||
cP *C.struct_CPxPlane
|
cP C.struct_CPxPlane
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPlane(nx, ny, nz, distance float32) *Plane {
|
func NewPlane(nx, ny, nz, distance float32) *Plane {
|
||||||
|
|
||||||
return &Plane{
|
return &Plane{
|
||||||
cP: C.NewCPxPlane(C.float(nx), C.float(ny), C.float(nz), C.float(distance)),
|
cP: C.NewCPxPlane(C.float(nx), C.float(ny), C.float(nz), C.float(distance)),
|
||||||
}
|
}
|
||||||
@ -637,6 +638,6 @@ func (rs *RigidStatic) ToRigidActor() RigidActor {
|
|||||||
|
|
||||||
func CreatePlane(p *Physics, plane *Plane, mat *Material) *RigidStatic {
|
func CreatePlane(p *Physics, plane *Plane, mat *Material) *RigidStatic {
|
||||||
return &RigidStatic{
|
return &RigidStatic{
|
||||||
cRs: C.CPxCreatePlane(p.cPhysics, plane.cP, mat.cM),
|
cRs: C.CPxCreatePlane(p.cPhysics, &plane.cP, mat.cM),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,18 +1,19 @@
|
|||||||
#ifndef CPxPlane_H
|
#ifndef CPxPlane_H
|
||||||
#define CPxPlane_H
|
#define CPxPlane_H
|
||||||
|
|
||||||
|
#include "CPxVec3.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//NOTE: Maybe convert this into a value type like CPxSphereGeometry?
|
|
||||||
struct CPxPlane
|
struct CPxPlane
|
||||||
{
|
{
|
||||||
void* obj;
|
CSTRUCT CPxVec3 n; //!< The normal to the plane
|
||||||
|
float d; //!< The distance from the origin
|
||||||
};
|
};
|
||||||
|
|
||||||
CPxAPI CSTRUCT CPxPlane* NewCPxPlane(float nx, float ny, float nz, float distance);
|
CPxAPI CSTRUCT CPxPlane NewCPxPlane(float nx, float ny, float nz, float distance);
|
||||||
CPxAPI void CPxPlane_release(CSTRUCT CPxPlane*);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user