public class RotationComponent extends DoubleComponent implements CopyableComponent<RotationComponent>
| Type | Property and Description |
|---|---|
javafx.beans.property.DoubleProperty |
angle |
valueProperty| Constructor and Description |
|---|
RotationComponent()
Constructs rotation with angle = 0.
|
RotationComponent(double angle)
Constructs rotation with given angle.
|
| Modifier and Type | Method and Description |
|---|---|
javafx.beans.property.DoubleProperty |
angleProperty() |
RotationComponent |
copy() |
void |
rotateBy(double byAngle)
Rotate entity view by given angle.
|
void |
rotateToVector(javafx.geometry.Point2D vector)
Set absolute rotation of the entity view to angle
between vector and positive X axis.
|
String |
toString() |
getValue, read, setValue, valueProperty, writegetEntity, onAdded, onRemovedpublic RotationComponent()
public RotationComponent(double angle)
angle - the anglepublic final void rotateBy(double byAngle)
PhysicsComponent.byAngle - rotation angle in degreespublic final void rotateToVector(javafx.geometry.Point2D vector)
vector - the rotation vector / velocity vectorpublic final javafx.beans.property.DoubleProperty angleProperty()
public String toString()
toString in class DoubleComponentpublic RotationComponent copy()
copy in interface CopyableComponent<RotationComponent>Copyright © 2017. All rights reserved.