28package com.jogamp.graph.geom;
30import com.jogamp.math.Vec2f;
31import com.jogamp.math.Vec3f;
32import com.jogamp.math.Vert3fImmutable;
39 private boolean onCurve;
44 this.id = Integer.MAX_VALUE;
49 this.id = Integer.MAX_VALUE;
55 public Vertex(
final int id,
final boolean onCurve,
final Vec3f texCoord) {
57 this.onCurve = onCurve;
58 this.texCoord.
set(texCoord);
61 public Vertex(
final int id,
final boolean onCurve,
final float texCoordX,
final float texCoordY,
final float texCoordZ) {
63 this.onCurve = onCurve;
64 this.texCoord.
set(texCoordX, texCoordY, texCoordZ);
68 this.id = Integer.MAX_VALUE;
69 this.coord.
set(coord);
74 this.id = Integer.MAX_VALUE;
75 this.coord.
set(coord, 0f);
79 public Vertex(
final float x,
final float y,
final boolean onCurve) {
80 this(
x,
y, 0, onCurve);
83 public Vertex(
final float[] coordsBuffer,
final int offset,
final int length,
final boolean onCurve) {
84 this(coordsBuffer[offset+0], coordsBuffer[offset+1], 2 < length ? coordsBuffer[offset+2] : 0f, onCurve);
87 public Vertex(
final float x,
final float y,
final float z,
final boolean onCurve) {
88 this.id = Integer.MAX_VALUE;
94 this.coord.
set(coord);
98 this.coord.
set(coord, 0f);
101 public final void setCoord(
final float x,
final float y,
final float z) {
119 public final void setX(
final float x) {
123 public final void setY(
final float y) {
127 public final void setZ(
final float z) {
132 public final float x() {
137 public final float y() {
142 public final float z() {
151 this.onCurve = onCurve;
158 public final void setId(
final int id){
167 public boolean equals(
final Object obj) {
171 if(
null == obj || !(obj instanceof
Vertex) ) {
183 throw new InternalError(
"hashCode not designed");
194 public final void setTexCoord(
final float s,
final float t,
final float p) {
195 texCoord.
set(s, t, p);
207 return "[ID: " +
id +
", onCurve: " + onCurve +
209 ", t " + texCoord +
"]";
A Vertex exposing Vec3f vertex- and texture-coordinates.
Vertex(final float[] coordsBuffer, final int offset, final int length, final boolean onCurve)
final void setCoord(final Vec3f coord)
final void setId(final int id)
Vertex(final int id, final boolean onCurve, final Vec3f texCoord)
Vertex(final Vec3f coord, final boolean onCurve)
final Vec3f getTexCoord()
final void setTexCoord(final Vec3f v)
Vertex(final Vec2f coord, final boolean onCurve)
final void setZ(final float z)
final void setOnCurve(final boolean onCurve)
final boolean isOnCurve()
final void setX(final float x)
boolean equals(final Object obj)
Vertex(final Vertex src)
Copy ctor.
void setCoord(final Vec2f coord)
final void setY(final float y)
final void setTexCoord(final float s, final float t, final float p)
Vertex(final float x, final float y, final boolean onCurve)
Vertex(final int id, final boolean onCurve, final float texCoordX, final float texCoordY, final float texCoordZ)
final void setCoord(final float x, final float y, final float z)
Vertex(final float x, final float y, final float z, final boolean onCurve)
final void setCoord(final float x, final float y)
2D Vector based upon two float components.
void set(final Vec2f o)
this = o, returns this.
3D Vector based upon three float components.
boolean isEqual(final Vec3f o, final float epsilon)
Equals check using a given FloatUtil#EPSILON value and FloatUtil#isEqual(float, float,...
Vec3f set(final Vec3f o)
this = o, returns this.