Package engine.entities
Class Entity
java.lang.Object
engine.entities.Entity
- Direct Known Subclasses:
Camera
Represents any 3D entity's textured model, position and rotation within the 3D world.
Camera extends this class by having position and rotation, but no textured model.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEntity
(TexturedModel model, org.joml.Vector3f position, float rotX, float rotY, float rotZ, float scale) Constructor for regular entities which have a TexturedModel.Entity
(org.joml.Vector3f position) Secondary Constructor used by the light and camera to position them in 3D space. -
Method Summary
Modifier and TypeMethodDescriptiongetModel()
org.joml.Vector3f
float
getRotX()
float
getRotY()
float
getRotZ()
float
getScale()
void
increasePosition
(float dx, float dy, float dz) Increase the position of the Entity by the addition of the Vector3f of x, y and zvoid
increaseRotation
(float dx, float dy, float dz) Increase the rotation of the Entity by the addition of the Vector3f of dx, dy and dzvoid
setModel
(TexturedModel model) void
setPosition
(org.joml.Vector3f position) void
setRotX
(float rotX) void
setRotY
(float rotY) void
setRotZ
(float rotZ) void
setScale
(float scale)
-
Field Details
-
position
protected org.joml.Vector3f position -
rotX
protected float rotX -
rotY
protected float rotY -
rotZ
protected float rotZ -
scale
protected float scale
-
-
Constructor Details
-
Entity
public Entity(TexturedModel model, org.joml.Vector3f position, float rotX, float rotY, float rotZ, float scale) Constructor for regular entities which have a TexturedModel.- Parameters:
model
- - The textured model of the entityposition
- - Position in 3D spacerotX
- - X rotationrotY
- - Y rotationrotZ
- Z - rotationscale
- - Size of the Entity relative to it's TexturedModel.
-
Entity
public Entity(org.joml.Vector3f position) Secondary Constructor used by the light and camera to position them in 3D space. Initializes rotation to 0. These 2 Entities have a visible effect on the game and shader's however they are not visible in game themselves.- Parameters:
position
- - Position in 3D space
-
-
Method Details
-
getModel
- Returns:
- TexturedModel of the Entity
-
setModel
- Parameters:
model
- - TexturedModel to which the Entity will be set
-
getPosition
public org.joml.Vector3f getPosition()- Returns:
- the position of the Entity in 3D space as a Vector3f
-
setPosition
public void setPosition(org.joml.Vector3f position) - Parameters:
position
- - Position in 3D space to which the Entity will be set to
-
getRotX
public float getRotX()- Returns:
- X rotation as a float
-
setRotX
public void setRotX(float rotX) - Parameters:
rotX
- set X rotation
-
getRotY
public float getRotY()- Returns:
- Y rotation as a float
-
setRotY
public void setRotY(float rotY) - Parameters:
rotY
- set Y rotation
-
getRotZ
public float getRotZ()- Returns:
- get Z rotation as a float
-
setRotZ
public void setRotZ(float rotZ) - Parameters:
rotZ
- Set the Z rotation
-
getScale
public float getScale()- Returns:
- The scale as a float
-
setScale
public void setScale(float scale) - Parameters:
scale
- set the scale
-
increasePosition
public void increasePosition(float dx, float dy, float dz) Increase the position of the Entity by the addition of the Vector3f of x, y and z- Parameters:
dx
-dy
-dz
-
-
increaseRotation
public void increaseRotation(float dx, float dy, float dz) Increase the rotation of the Entity by the addition of the Vector3f of dx, dy and dz- Parameters:
dx
-dy
-dz
-
-