/** * Instantiate a point collision shape based on the specified points. * * @param point1 the coordinates of point (not null, alias created) */ public SimplexCollisionShape(Vector3f point1) { vector1 = point1; createShape(); }
/** * Creates a cylinder shape around the given axis from the given halfextents * @param halfExtents the halfextents to use * @param axis (0=X,1=Y,2=Z) */ public CylinderCollisionShape(Vector3f halfExtents, int axis) { this.halfExtents = halfExtents; this.axis = axis; createShape(); }
/** * Creates a new cone collision shape with the given height, radius and default Y axis. * * @param radius The radius of the cone in world units. * @param height The height of the cone in world units. */ public ConeCollisionShape(float radius, float height) { this.radius = radius; this.height = height; this.axis = PhysicsSpace.AXIS_Y; createShape(); }
/** * Instantiate a collision shape based on the specified JME mesh. For best * performance and stability, use the mesh should have no more than 100 * vertices. * * @param mesh a mesh on which to base the shape (not null, at least one * vertex) */ public HullCollisionShape(Mesh mesh) { this.points = getPoints(mesh); createShape(); }
/** * Instantiate a Y-axis capsule shape with the specified radius and height. * * @param radius the desired radius (≥0) * @param height the desired height (of the cylindrical portion) (≥0) */ public CapsuleCollisionShape(float radius, float height) { this.radius=radius; this.height=height; this.axis=1; createShape(); }
/** * Instantiate a new shape for the specified height map and scale vector. * * @param heightmap (not null, length≥4, length a perfect square) * @param scale (not null, no negative component, unaffected, default=1,1,1) */ public HeightfieldCollisionShape(float[] heightmap, Vector3f scale) { createCollisionHeightfield(heightmap, scale); }
/** * creates a collision box from the given halfExtents * @param halfExtents the halfExtents of the CollisionBox */ public BoxCollisionShape(Vector3f halfExtents) { this.halfExtents = halfExtents; createShape(); }
/** * Instantiate a sphere shape with the specified radius. * * @param radius the desired radius (≥0) */ public SphereCollisionShape(float radius) { this.radius = radius; createShape(); }
/** * Instantiate a plane shape defined by the specified plane. * * @param plane the desired plane (not null, alias created) */ public PlaneCollisionShape(Plane plane) { this.plane = plane; createShape(); }
/** * Instantiate a shape based on the specified JME mesh. * * @param mesh the Mesh to use */ public GImpactCollisionShape(Mesh mesh) { createCollisionMesh(mesh); }
/** * Instantiate a collision shape based on the specified array of * coordinates. * * @param points an array of coordinates on which to base the shape (not * null, not empty, length a multiple of 3) */ public HullCollisionShape(float[] points) { this.points = points; createShape(); }
public SimplexCollisionShape(Vector3f point1, Vector3f point2, Vector3f point3, Vector3f point4) { vector1 = point1; vector2 = point2; vector3 = point3; vector4 = point4; createShape(); }
/** * Instantiate a Z-axis cylinder shape with the specified half extents. * * @param halfExtents the desired unscaled half extents (not null, no * negative component, alias created) */ public CylinderCollisionShape(Vector3f halfExtents) { this.halfExtents = halfExtents; this.axis = 2; createShape(); }
/** * Instantiate a cone shape oriented along the Y axis. * * @param radius the desired radius (≥0) * @param height the desired height (≥0) */ public ConeCollisionShape(float radius, float height) { this.radius = radius; this.height = height; this.axis = PhysicsSpace.AXIS_Y; createShape(); }
/** * Creates a capsule shape around the given axis (0=X,1=Y,2=Z). * @param radius * @param height * @param axis */ public CapsuleCollisionShape(float radius, float height, int axis) { this.radius=radius; this.height=height; this.axis=axis; createShape(); }
/** * Instantiate a new shape for the specified height map. * * @param heightmap (not null, length≥4, length a perfect square) */ public HeightfieldCollisionShape(float[] heightmap) { createCollisionHeightfield(heightmap, Vector3f.UNIT_XYZ); }
public SimplexCollisionShape(Vector3f point1, Vector3f point2, Vector3f point3) { vector1 = point1; vector2 = point2; vector3 = point3; createShape(); }
/** * Instantiate a cylinder shape around the specified axis. * * @param halfExtents the desired unscaled half extents (not null, no * negative component, alias created) * @param axis which local axis: 0→X, 1→Y, 2→Z */ public CylinderCollisionShape(Vector3f halfExtents, int axis) { this.halfExtents = halfExtents; this.axis = axis; createShape(); }
public SimplexCollisionShape(Vector3f point1, Vector3f point2) { vector1 = point1; vector2 = point2; createShape(); }
/** * creates a cylinder shape from the given halfextents * @param halfExtents the halfextents to use */ public CylinderCollisionShape(Vector3f halfExtents) { this.halfExtents = halfExtents; this.axis = 2; createShape(); }