Module technology.sola.engine
Class SolaEntityGraphicsModule<V extends technology.sola.ecs.view.ViewEntry>
java.lang.Object
technology.sola.engine.graphics.modules.SolaGraphicsModule
technology.sola.engine.graphics.modules.SolaEntityGraphicsModule<V>
- All Implemented Interfaces:
Comparable<SolaGraphicsModule>
- Direct Known Subclasses:
CircleEntityGraphicsModule,ConvexPolygonEntityGraphicsModule,DebugGraphicsModule,ParticleEmitterEntityGraphicsModule,RectangleEntityGraphicsModule,SpriteEntityGraphicsModule,TriangleEntityGraphicsModule
@NullMarked
public abstract class SolaEntityGraphicsModule<V extends technology.sola.ecs.view.ViewEntry>
extends SolaGraphicsModule
SolaEntityGraphicsModule adds rendering functionality to
SolaGraphics for
rendering Entity that have specified Components.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TransformComponentgetTransformForAppliedCamera(TransformComponent entityTransform, Matrix3D cameraScaleTransform, Matrix3D cameraTranslationTransform) Utility method for calculating the transform when a camera's transform is applied to another transform.abstract technology.sola.ecs.view.View<V>getViewToRender(technology.sola.ecs.World world) abstract voidrenderEntity(Renderer renderer, V viewEntry, TransformComponent cameraModifiedEntityTransform) Called on eachEntityto render it.voidrenderEntity(Renderer renderer, V viewEntry, Matrix3D cameraScaleTransform, Matrix3D cameraTranslationTransform) Called on eachEntityto render it.voidrenderMethod(Renderer renderer, technology.sola.ecs.World world, Matrix3D cameraScaleTransform, Matrix3D cameraTranslationTransform) The specific render method for a graphics module that is called once per frame if active.
-
Constructor Details
-
SolaEntityGraphicsModule
public SolaEntityGraphicsModule()
-
-
Method Details
-
getViewToRender
- Parameters:
world- theWorld- Returns:
- the view of entities
-
renderEntity
public abstract void renderEntity(Renderer renderer, V viewEntry, TransformComponent cameraModifiedEntityTransform) Called on eachEntityto render it. ATransformComponentinstance with the camera's transform applied is provided for each entity. If an entity has aLayerComponentit will be rendered to its layer.- Parameters:
renderer- tbeRendererinstanceviewEntry- theViewEntrycontaining theEntityto rendercameraModifiedEntityTransform- aTransformComponentwith the camera's transform applied to the entity's transform
-
renderEntity
public void renderEntity(Renderer renderer, V viewEntry, Matrix3D cameraScaleTransform, Matrix3D cameraTranslationTransform) Called on eachEntityto render it. It calculates aTransformComponentinstance with the camera's transform applied which is then passed into therenderEntity(Renderer, ViewEntry, TransformComponent)method. If an entity has aLayerComponentit will be rendered to its layer.- Parameters:
renderer- tbeRendererinstanceviewEntry- theViewEntrycontaining theEntityto rendercameraScaleTransform- the camera's scalecameraTranslationTransform- the camera's translation
-
renderMethod
public void renderMethod(Renderer renderer, technology.sola.ecs.World world, Matrix3D cameraScaleTransform, Matrix3D cameraTranslationTransform) Description copied from class:SolaGraphicsModuleThe specific render method for a graphics module that is called once per frame if active.- Specified by:
renderMethodin classSolaGraphicsModule- Parameters:
renderer- tbeRendererinstanceworld- theWorldinstancecameraScaleTransform- the camera's scalecameraTranslationTransform- the camera's translation
-
getTransformForAppliedCamera
protected TransformComponent getTransformForAppliedCamera(TransformComponent entityTransform, Matrix3D cameraScaleTransform, Matrix3D cameraTranslationTransform) Utility method for calculating the transform when a camera's transform is applied to another transform.- Parameters:
entityTransform- theEntity's transformcameraScaleTransform- the camera's scalecameraTranslationTransform- the camera's translate- Returns:
- the resulting
TransformComponent
-