@NoOffset @Properties(inherit=liquidfun.class) public class b2PolygonShape extends b2Shape
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
b2PolygonShape() |
b2PolygonShape(long size)
Native array allocator.
|
b2PolygonShape(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
b2Shape |
Clone(b2BlockAllocator allocator)
Implement b2Shape.
|
void |
ComputeAABB(b2AABB aabb,
b2Transform transform,
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.
|
b2PolygonShape |
getPointer(long i) |
b2Vec2 |
GetVertex(int index)
Get a vertex by index.
|
int |
GetVertexCount()
Get the vertex count.
|
b2Vec2 |
m_centroid() |
b2PolygonShape |
m_centroid(b2Vec2 setter) |
int |
m_count() |
b2PolygonShape |
m_count(int setter) |
b2Vec2 |
m_normals() |
b2Vec2 |
m_normals(int i) |
b2PolygonShape |
m_normals(int i,
b2Vec2 setter) |
b2Vec2 |
m_vertices() |
b2Vec2 |
m_vertices(int i) |
b2PolygonShape |
m_vertices(int i,
b2Vec2 setter) |
b2PolygonShape |
position(long position) |
boolean |
RayCast(b2RayCastOutput output,
b2RayCastInput input,
b2Transform transform,
int childIndex)
Implement b2Shape.
|
void |
Set(b2Vec2 points,
int count)
Create a convex hull from the given array of local points.
|
void |
SetAsBox(float hx,
float hy)
Build vertices to represent an axis-aligned box centered on the local origin.
|
void |
SetAsBox(float hx,
float hy,
b2Vec2 center,
float angle)
Build vertices to represent an oriented box.
|
void |
SetAsBox(float hx,
float hy,
float centerX,
float centerY,
float angle)
SetAsBox with direct floats for center.
|
void |
SetCentroid(float x,
float y)
Set centroid with direct floats.
|
boolean |
TestPoint(b2Transform transform,
b2Vec2 p)
Test a point for containment in this shape.
|
boolean |
Validate()
Validate convexity.
|
GetType, m_radius, m_radius, m_type, m_type
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public b2PolygonShape(Pointer p)
Pointer(Pointer)
.public b2PolygonShape(long size)
Pointer.position(long)
.public b2PolygonShape()
public b2PolygonShape position(long position)
public b2PolygonShape getPointer(long i)
getPointer
in class Pointer
public b2Shape Clone(b2BlockAllocator allocator)
@Cast(value="int32") public int GetChildCount()
b2Shape
GetChildCount
in class b2Shape
b2Shape::GetChildCount
public void Set(@Const b2Vec2 points, @Cast(value="int32") int count)
public void SetAsBox(@Cast(value="float32") float hx, @Cast(value="float32") float hy)
hx
- the half-width.hy
- the half-height.public void SetAsBox(@Cast(value="float32") float hx, @Cast(value="float32") float hy, @Const @ByRef b2Vec2 center, @Cast(value="float32") float angle)
hx
- the half-width.hy
- the half-height.center
- the center of the box in local coordinates.angle
- the rotation of the box in local coordinates.@Cast(value="bool") public boolean TestPoint(@Const @ByRef b2Transform transform, @Const @ByRef b2Vec2 p)
b2Shape
public void ComputeDistance(@Const @ByRef b2Transform xf, @Const @ByRef b2Vec2 p, @Cast(value="float32*") FloatPointer distance, b2Vec2 normal, @Cast(value="int32") int childIndex)
b2Shape
ComputeDistance
in class b2Shape
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)
ComputeDistance
in class b2Shape
public void ComputeDistance(@Const @ByRef b2Transform xf, @Const @ByRef b2Vec2 p, @Cast(value="float32*") float[] distance, b2Vec2 normal, @Cast(value="int32") int childIndex)
ComputeDistance
in class b2Shape
@Cast(value="bool") public boolean RayCast(b2RayCastOutput output, @Const @ByRef b2RayCastInput input, @Const @ByRef b2Transform transform, @Cast(value="int32") int childIndex)
public void ComputeAABB(b2AABB aabb, @Const @ByRef b2Transform transform, @Cast(value="int32") int childIndex)
b2Shape
ComputeAABB
in class b2Shape
aabb
- returns the axis aligned box.transform
- the world transform of the shape.childIndex
- the child shapeb2Shape::ComputeAABB
public void ComputeMass(b2MassData massData, @Cast(value="float32") float density)
b2Shape
ComputeMass
in class b2Shape
massData
- returns the mass data for this shape.density
- the density in kilograms per meter squared.b2Shape::ComputeMass
@Const @ByRef public b2Vec2 GetVertex(@Cast(value="int32") int index)
@Cast(value="bool") public boolean Validate()
public void SetCentroid(@Cast(value="float32") float x, @Cast(value="float32") float y)
public void SetAsBox(@Cast(value="float32") float hx, @Cast(value="float32") float hy, @Cast(value="float32") float centerX, @Cast(value="float32") float centerY, @Cast(value="float32") float angle)
b2Shape::SetAsBox
public b2PolygonShape m_centroid(b2Vec2 setter)
public b2PolygonShape m_vertices(int i, b2Vec2 setter)
@MemberGetter public b2Vec2 m_vertices()
public b2PolygonShape m_normals(int i, b2Vec2 setter)
@MemberGetter public b2Vec2 m_normals()
public b2PolygonShape m_count(int setter)
Copyright © 2022. All rights reserved.