101 static void combineNode(
Node* sourceNode,
const vector<Vector3>& origins,
const vector<Matrix4x4>& objectParentTransformationsMatrices,
Model* combinedModel);
111 static void combineObjects(
Model* model,
const vector<Transformations>& objectsTransformations,
Model* combinedModel);
142 int modelLOD2ReduceBy = 4,
143 int modelLOD3ReduceBy = 16,
216 inline const string&
getId()
override {
TDME2 engine entity shader parameters.
void setShaderParameter(const string ¶meterName, const ShaderParameter ¶meterValue)
Set shader parameter for given parameter name.
void setShader(const string &shaderId)
Set shader.
const ShaderParameter getShaderParameter(const string ¶meterName) const
Returns shader parameter for given parameter name, if the value does not exist, the default will be r...
virtual void setRenderPass(RenderPass renderPass)=0
Set render pass.
virtual EntityType getEntityType()=0
virtual BoundingBox * getBoundingBox()=0
virtual void setContributesShadows(bool contributesShadows)=0
Enable/disable contributes shadows.
@ ENTITYTYPE_OBJECT3DRENDERGROUP
virtual void setPickable(bool pickable)=0
Set this object pickable.
virtual void setReceivesShadows(bool receivesShadows)=0
Enable/disable receives shadows.
LOD object 3D to be used with engine class.
const string & getShader()
const string & getDistanceShader()
Object 3D render group for static objects that might be animated by shaders.
const Matrix4x4 & getTransformationsMatrix() const override
map< Model *, vector< Transformations > > transformationsByModel
BoundingBox boundingBoxTransformed
const Color4 & getEffectColorAdd() const override
The effect color will be added to fragment color.
RenderPass getRenderPass() const override
void dispose() override
Dispose this object 3d.
void setShader(const string &id)
Set shader id.
Object3DRenderGroup(const string &id, int lodLevels=1, float modelLOD2MinDistance=25.0f, float modelLOD3MinDistance=50.0f, int modelLOD2ReduceBy=4, int modelLOD3ReduceBy=16, bool optimizeModels=true)
Public constructor.
void setTranslation(const Vector3 &translation) override
Set translation.
~Object3DRenderGroup()
Destructor.
void setParentEntity(Entity *entity) override
Set parent entity, needs to be called before adding to engine.
void removeRotation(const int idx) override
Remove rotation.
void setPivot(const Vector3 &pivot) override
Set pivot.
const int getRotationCount() const override
const Quaternion & getRotationsQuaternion() const override
void initialize() override
Initiates this object 3d.
bool isReceivesShadows() override
EntityShaderParameters shaderParameters
BoundingBox * getBoundingBox() override
void setRenderPass(RenderPass renderPass) override
Set render pass.
void setReceivesShadows(bool receivesShadows) override
Enable/disable receives shadows.
const string & getShader()
void addRotation(const Vector3 &axis, const float angle) override
Add rotation.
void update() override
Update transformations.
static void combineObjects(Model *model, const vector< Transformations > &objectsTransformations, Model *combinedModel)
Combine model with transformations into current model.
void addObject(Model *model, const Transformations &transformations)
Adds a instance to this render group.
const string & getId() override
void setPickable(bool pickable) override
Set this object pickable.
void updateRenderGroup()
Update render group model and bounding box.
array< int, 3 > lodReduceBy
float getDistanceShaderDistance()
Entity * getParentEntity() override
void setEffectColorMul(const Color4 &effectColorMul) override
Set effect color that will be multiplied with fragment color.
float modelLOD3MinDistance
const ShaderParameter getShaderParameter(const string ¶meterName)
Returns shader parameter for given parameter name, if the value does not exist, the default will be r...
bool isPickable() override
const Vector3 & getTranslation() const override
void setShaderParameter(const string ¶meterName, const ShaderParameter ¶meterValue)
Set shader parameter for given parameter name.
static void combineNode(Node *sourceNode, const vector< Vector3 > &origins, const vector< Matrix4x4 > &objectParentTransformationsMatrices, Model *combinedModel)
Combine node into given combined model.
float distanceShaderDistance
const ShaderParameter getDistanceShaderParameter(const string ¶meterName)
Returns distance shader parameter for given parameter name, if the value does not exist,...
void fromTransformations(const Transformations &transformations) override
Set up this transformations from given transformations.
void updateBoundingBox()
Compute bounding box.
bool enableEarlyZRejection
const string & getDistanceShader()
const Color4 & getEffectColorMul() const override
The effect color will be multiplied with fragment color.
const Vector3 & getScale() const override
const Vector3 & getPivot() const override
float modelLOD2MinDistance
void setEnableEarlyZRejection(bool enableEarlyZRejection)
Enable/disable early z rejection.
bool isEnableEarlyZRejection() const
BoundingBox * getBoundingBoxTransformed() override
void setDistanceShader(const string &id)
Set distance shader id.
void setScale(const Vector3 &scale) override
Set scale.
bool isContributesShadows() override
EntityShaderParameters distanceShaderParameters
void applyParentTransformations(const Transformations &parentTransformations) override
Apply parent transformations.
const float getRotationAngle(const int idx) const override
const Transformations & getTransformations() const override
void setFrustumCulling(bool frustumCulling) override
Set frustum culling.
void setEngine(Engine *engine) override
Set up engine.
void setEnabled(bool enabled) override
Enable/disable rendering.
EntityType getEntityType() override
vector< Model * > combinedModels
const Vector3 & getRotationAxis(const int idx) const override
void setDistanceShaderDistance(float distanceShaderDistance)
Set distance shader distance.
void setContributesShadows(bool contributesShadows) override
Enable/disable contributes shadows.
void setRotationAxis(const int idx, const Vector3 &axis) override
Set rotation axis.
bool isFrustumCulling() override
bool isEnabled() override
Rotation & getRotation(const int idx) override
Get rotation at given index.
void setEffectColorAdd(const Color4 &effectColorAdd) override
Set effect color that will be added to fragment color.
void setDistanceShaderParameter(const string ¶meterName, const ShaderParameter ¶meterValue)
Set distance shader parameter for given parameter name.
void setRenderer(Renderer *renderer) override
Set up renderer.
void setRotationAngle(const int idx, const float angle) override
Object 3D to be used with engine class.
const string & getShader()
const string & getDistanceShader()
Shader parameter model class.
Representation of a 3d model.
Axis aligned bounding box used for frustum, this is not directly connectable with physics engine.
void fromBoundingVolumeWithTransformations(BoundingBox *original, const Transformations &transformations)
Create bounding volume from given original(of same type) with applied transformations.
void fromBoundingVolume(BoundingBox *original)
Set up this bounding volume from given bounding volume.