@Properties(inherit=liquidfun.class) public class b2Shape extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Modifier and Type | Field and Description |
---|---|
static int |
e_chain
enum b2Shape::Type
|
static int |
e_circle
enum b2Shape::Type
|
static int |
e_edge
enum b2Shape::Type
|
static int |
e_polygon
enum b2Shape::Type
|
static int |
e_typeCount
enum b2Shape::Type
|
Constructor and Description |
---|
b2Shape(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
b2Shape |
Clone(b2BlockAllocator allocator)
Clone the concrete shape using the provided allocator.
|
void |
ComputeAABB(b2AABB aabb,
b2Transform xf,
int childIndex)
Given a transform, compute the associated axis aligned bounding box for a child shape.
|
void |
ComputeDistance(b2Transform xf,
b2Vec2 p,
float[] distance,
b2Vec2 normal,
int childIndex) |
void |
ComputeDistance(b2Transform xf,
b2Vec2 p,
FloatBuffer distance,
b2Vec2 normal,
int childIndex) |
void |
ComputeDistance(b2Transform xf,
b2Vec2 p,
FloatPointer distance,
b2Vec2 normal,
int childIndex)
Compute the distance from the current shape to the specified point.
|
void |
ComputeMass(b2MassData massData,
float density)
Compute the mass properties of this shape using its dimensions and density.
|
int |
GetChildCount()
Get the number of child primitives.
|
int |
GetType()
Get the type of this shape.
|
float |
m_radius() |
b2Shape |
m_radius(float setter) |
int |
m_type() |
b2Shape |
m_type(int setter) |
boolean |
RayCast(b2RayCastOutput output,
b2RayCastInput input,
b2Transform transform,
int childIndex)
Cast a ray against a child shape.
|
boolean |
TestPoint(b2Transform xf,
b2Vec2 p)
Test a point for containment in this shape.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public static final int e_circle
public static final int e_edge
public static final int e_polygon
public static final int e_chain
public static final int e_typeCount
public b2Shape(Pointer p)
Pointer(Pointer)
.public b2Shape Clone(b2BlockAllocator allocator)
@Cast(value="b2Shape::Type") public int GetType()
@Cast(value="bool") public boolean TestPoint(@Const @ByRef b2Transform xf, @Const @ByRef b2Vec2 p)
xf
- the shape world transform.p
- a point in world coordinates.public void ComputeDistance(@Const @ByRef b2Transform xf, @Const @ByRef b2Vec2 p, @Cast(value="float32*") FloatPointer distance, b2Vec2 normal, @Cast(value="int32") int childIndex)
xf
- the shape world transform.p
- a point in world coordinates.distance
- returns the distance from the current shape.normal
- returns the direction in which the distance increases.public void ComputeDistance(@Const @ByRef b2Transform xf, @Const @ByRef b2Vec2 p, @Cast(value="float32*") FloatBuffer distance, b2Vec2 normal, @Cast(value="int32") int childIndex)
public void ComputeDistance(@Const @ByRef b2Transform xf, @Const @ByRef b2Vec2 p, @Cast(value="float32*") float[] distance, b2Vec2 normal, @Cast(value="int32") int childIndex)
@Cast(value="bool") public boolean RayCast(b2RayCastOutput output, @Const @ByRef b2RayCastInput input, @Const @ByRef b2Transform transform, @Cast(value="int32") int childIndex)
output
- the ray-cast results.input
- the ray-cast input parameters.transform
- the transform to be applied to the shape.childIndex
- the child shape indexpublic void ComputeAABB(b2AABB aabb, @Const @ByRef b2Transform xf, @Cast(value="int32") int childIndex)
aabb
- returns the axis aligned box.xf
- the world transform of the shape.childIndex
- the child shapepublic void ComputeMass(b2MassData massData, @Cast(value="float32") float density)
massData
- returns the mass data for this shape.density
- the density in kilograms per meter squared.public b2Shape m_type(int setter)
public b2Shape m_radius(float setter)
Copyright © 2022. All rights reserved.