Commit 714269ae authored by Ken Martin's avatar Ken Martin
Browse files

added UserMatrix

parent bb233086
......@@ -68,6 +68,13 @@ class vlActor : public vlObject
// Returns the Mapper that this actor is getting it's data from.
vlGetObjectMacro(Mapper,vlMapper);
// Description:
// Set a user defined matrix to concatenate with.
vlSetObjectMacro(UserMatrix,vlMatrix4x4);
// Description:
// Returns the user defined transformation matrix.
vlGetObjectMacro(UserMatrix,vlMatrix4x4);
// Description:
// Get the position of the actor.
vlGetVectorMacro(Position,float,3);
......@@ -160,6 +167,7 @@ class vlActor : public vlObject
void AddOrientation(float a[3]);
protected:
vlMatrix4x4 *UserMatrix;
vlProperty *Property;
vlTexture *Texture;
vlMapper *Mapper;
......
......@@ -27,6 +27,7 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
// automatically created. Try to use MakeActor() whenever possible.
vlActor::vlActor()
{
this->UserMatrix = NULL;
this->Mapper = NULL;
this->Property = NULL;
this->Texture = NULL;
......@@ -228,6 +229,12 @@ void vlActor::GetMatrix(vlMatrix4x4& result)
this->Transform.Identity();
this->Transform.PreMultiply();
// apply user defined matrix last if there is one
if (this->UserMatrix)
{
this->Transform.Concatenate(*this->UserMatrix);
}
// first translate
this->Transform.Translate(this->Position[0],
this->Position[1],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment