public class RotationComponent extends com.almasb.ents.component.DoubleComponent implements com.almasb.ents.CopyableComponent<RotationComponent>
| Type | Property and Description |
|---|---|
javafx.beans.property.DoubleProperty |
angle |
| 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() |
public 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 com.almasb.ents.component.DoubleComponentpublic RotationComponent copy()
copy in interface com.almasb.ents.CopyableComponent<RotationComponent>Copyright © 2016. All rights reserved.