Package net.apartium.cocoabeans.space
Class ImmutablePosition
java.lang.Object
net.apartium.cocoabeans.space.Position
net.apartium.cocoabeans.space.ImmutablePosition
Immutable version of Position
When the position is modified, a new Position is created
and the original one is left unchanged
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionImmutablePosition(double x, double y, double z) ImmutablePosition(Position other) -
Method Summary
Modifier and TypeMethodDescriptionabs()Sets the x, y, z coordinates to their absolute values.Adds another position to this position.ceil()Ceils the x, y, z coordinates.crossProduct(Position other) Computes the cross product with another position.divide(double scalar) Divides this position by a scalar.floor()Floors the x, y, z coordinates.Returns an immutable version of this position.multiply(double scalar) Multiplies this position by a scalar.negate()Negates this position.Normalizes this position vector.round()Rounds the x, y, z coordinates.round(int places) Rounds the x, y, z coordinates to the specified number of decimal places.setX(double x) Sets the x coordinate.setY(double y) Sets the y coordinate.setZ(double z) Sets the z coordinate.Subtracts another position from this position.
-
Constructor Details
-
ImmutablePosition
public ImmutablePosition(double x, double y, double z) -
ImmutablePosition
-
-
Method Details
-
setX
Description copied from class:PositionSets the x coordinate. -
setY
Description copied from class:PositionSets the y coordinate. -
setZ
Description copied from class:PositionSets the z coordinate. -
add
Description copied from class:PositionAdds another position to this position. -
subtract
Description copied from class:PositionSubtracts another position from this position. -
multiply
Description copied from class:PositionMultiplies this position by a scalar. -
divide
Description copied from class:PositionDivides this position by a scalar. -
crossProduct
Description copied from class:PositionComputes the cross product with another position.- Overrides:
crossProductin classPosition- Parameters:
other- the other position- Returns:
- cross product position
-
floor
Description copied from class:PositionFloors the x, y, z coordinates. -
ceil
Description copied from class:PositionCeils the x, y, z coordinates. -
round
Description copied from class:PositionRounds the x, y, z coordinates. -
round
Description copied from class:PositionRounds the x, y, z coordinates to the specified number of decimal places. -
abs
Description copied from class:PositionSets the x, y, z coordinates to their absolute values. -
negate
Description copied from class:PositionNegates this position. -
normalize
Description copied from class:PositionNormalizes this position vector. -
immutable
Description copied from class:PositionReturns an immutable version of this position.
-