Package net.apartium.cocoabeans.space
Class Transform
java.lang.Object
net.apartium.cocoabeans.space.Transform
Represents a transform in 3D space, combining position and rotation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCreate a direction vector based on the current rotationfloatgetPitch()Returns the pitchReturns the position Changes on the returned object will be reflected in this oneReturns the rotation Changes on the returned object will be reflected in this onedoublegetX()Returns the x coordinatedoublegetY()Returns the y coordinatefloatgetYaw()Returns the yawdoublegetZ()Returns the z coordinateinthashCode()Rotate the transform by a given rotationsetPitch(float pitch) Sets the pitchsetPosition(Position position) Sets the positionsetRotation(Rotation rotation) Sets the rotationsetX(double x) Sets the x coordinatesetY(double y) Sets the y coordinatesetYaw(float yaw) Sets the yawsetZ(double z) Sets the z coordinatetoString()Translate the transform by a given position
-
Constructor Details
-
Transform
public Transform(double x, double y, double z, float yaw, float pitch) Create a new transform- Parameters:
x- xy- yz- zyaw- yawpitch- pitch
-
Transform
Create a new transform- Parameters:
position- positionrotation- rotation
-
Transform
Create a new transform from another one- Parameters:
other- source
-
-
Method Details
-
getX
public double getX()Returns the x coordinate- Returns:
- x
-
setX
Sets the x coordinate- Parameters:
x- new x- Returns:
- this
-
getY
public double getY()Returns the y coordinate- Returns:
- y
-
setY
Sets the y coordinate- Parameters:
y- new y- Returns:
- this
-
getZ
public double getZ()Returns the z coordinate- Returns:
- z
-
setZ
Sets the z coordinate- Parameters:
z- new z- Returns:
- this
-
getYaw
public float getYaw()Returns the yaw- Returns:
- yaw
-
setYaw
Sets the yaw- Parameters:
yaw- new yaw- Returns:
- this
-
getPitch
public float getPitch()Returns the pitch- Returns:
- pitch
-
setPitch
Sets the pitch- Parameters:
pitch- new pitch- Returns:
- this
-
getPosition
Returns the position Changes on the returned object will be reflected in this one- Returns:
- position
-
setPosition
Sets the position- Parameters:
position- new position- Returns:
- this
-
getRotation
Returns the rotation Changes on the returned object will be reflected in this one- Returns:
- rotation
-
setRotation
Sets the rotation- Parameters:
rotation- new rotation- Returns:
- this
-
translate
Translate the transform by a given position- Parameters:
translation- position to translate by- Returns:
- this
-
rotate
Rotate the transform by a given rotation- Parameters:
deltaRotation- rotation to rotate by- Returns:
- this
-
getDirectionVector
Create a direction vector based on the current rotation- Returns:
- direction vector
-
toString
-
equals
-
hashCode
public int hashCode()
-