Beispiel #1
0
func cToGeom(c C.dGeomID) Geom {
	base := GeomBase(unsafe.Pointer(c))
	var g Geom
	switch int(C.dGeomGetClass(c)) {
	case SphereClass:
		g = Sphere{base}
	case BoxClass:
		g = Box{base}
	case CapsuleClass:
		g = Capsule{base}
	case CylinderClass:
		g = Cylinder{base}
	case PlaneClass:
		g = Plane{base}
	case RayClass:
		g = Ray{base}
	case HeightfieldClass:
		g = Heightfield{base}
	case TriMeshClass:
		g = TriMesh{base}
	default:
		g = base
	}
	return g
}
Beispiel #2
0
// Class returns the geometry class.
func (g GeomBase) Class() int {
	return int(C.dGeomGetClass(g.c()))
}