Package ch.bailu.gtk.graphene
Klasse Point
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.graphene.Point
- Alle implementierten Schnittstellen:
PointerInterface
A point with two coordinates.
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Point
Allocates a new #graphene_point_t structure.float
Computes the distance between @a and @b.boolean
Checks if the two points @a and @b point to the same
coordinates.void
free()
Frees the resources allocated by graphene_point_alloc().static ClassHandler
float
the X coordinate of the pointfloat
the Y coordinate of the pointstatic int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
init
(float x, float y) Initializes @p to the given @x and @y coordinates.initFromPoint
(Point src) Initializes @p with the same coordinates of @src.initFromVec2
(Vec2 src) Initializes @p with the coordinates inside the given #graphene_vec2_t.void
interpolate
(Point b, double factor, Point res) Linearly interpolates the coordinates of @a and @b using the
given @factor.boolean
Checks whether the two points @a and @b are within
the threshold of @epsilon.void
setFieldX
(float x) the X coordinate of the pointvoid
setFieldY
(float y) the Y coordinate of the pointvoid
Stores the coordinates of the given #graphene_point_t into a
#graphene_vec2_t.static Point
zero()
Returns a point fixed at (0, 0).Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
X
the X coordinate of the point- Siehe auch:
-
Y
the Y coordinate of the point- Siehe auch:
-
-
Konstruktordetails
-
Point
-
Point
public Point()
-
-
Methodendetails
-
getClassHandler
-
setFieldX
public void setFieldX(float x) the X coordinate of the point -
getFieldX
public float getFieldX()the X coordinate of the point -
setFieldY
public void setFieldY(float y) the Y coordinate of the point -
getFieldY
public float getFieldY()the Y coordinate of the point -
allocPoint
Allocates a new #graphene_point_t structure.
The coordinates of the returned point are (0, 0).
It's possible to chain this function with graphene_point_init()
or graphene_point_init_from_point(), e.g.:
<!-- language="C" --> graphene_point_t * point_new (float x, float y) { return graphene_point_init (graphene_point_alloc (), x, y); } graphene_point_t * point_copy (const graphene_point_t *p) { return graphene_point_init_from_point (graphene_point_alloc (), p); }
- Gibt zurück:
- the newly allocated #graphene_point_t. Use graphene_point_free() to free the resources allocated by this function.
-
distance
Computes the distance between @a and @b.- Parameter:
b
- a #graphene_point_td_x
- distance component on the X axisd_y
- distance component on the Y axis- Gibt zurück:
- the distance between the two points
-
equal
Checks if the two points @a and @b point to the same
coordinates.
This function accounts for floating point fluctuations; if
you want to control the fuzziness of the match, you can use
graphene_point_near() instead.- Parameter:
b
- a #graphene_point_t- Gibt zurück:
- `true` if the points have the same coordinates
-
free
public void free()Frees the resources allocated by graphene_point_alloc(). -
init
Initializes @p to the given @x and @y coordinates.
It's safe to call this function multiple times.- Parameter:
x
- the X coordinatey
- the Y coordinate- Gibt zurück:
- the initialized point
-
initFromPoint
Initializes @p with the same coordinates of @src.- Parameter:
src
- the #graphene_point_t to use- Gibt zurück:
- the initialized point
-
initFromVec2
Initializes @p with the coordinates inside the given #graphene_vec2_t.- Parameter:
src
- a #graphene_vec2_t- Gibt zurück:
- the initialized point
-
interpolate
Linearly interpolates the coordinates of @a and @b using the
given @factor.- Parameter:
b
- a #graphene_point_tfactor
- the linear interpolation factorres
- return location for the interpolated point
-
near
Checks whether the two points @a and @b are within
the threshold of @epsilon.- Parameter:
b
- a #graphene_point_tepsilon
- threshold between the two points- Gibt zurück:
- `true` if the distance is within @epsilon
-
toVec2
Stores the coordinates of the given #graphene_point_t into a
#graphene_vec2_t.- Parameter:
v
- return location for the vertex
-
zero
Returns a point fixed at (0, 0).- Gibt zurück:
- a fixed point
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-