Texture Class Reference

Base class for all textures. More...

#include <Texture.h>

Inheritance diagram for Texture:

Inheritance graph
[legend]
Collaboration diagram for Texture:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Texture ()
 Texture (HTreeObject *htreeobject)
virtual BOOL Evaluate (const Vector &evalp, HTexInfo *texinfo)=0
virtual BOOL EvaluateTransparency (const Vector &evalp, HTexInfo *texinfo)=0
virtual HObjectListNodeGetPointerList (HPointerPropertyBase *prop)
virtual void CheckOut (HHashObject *cache)
virtual void OnNotifyNewProperty (HProperty *prop, const String &matchname)
HModelGetModel ()
HGroupGetGroup ()

Detailed Description

Base class for all textures.

To write a texture plug-in for Animation Master you must derive a class from the Texture class provided in "Texture.h". The derivation should look something like this:

class MyCoolTexture : public Texture; 

Once you have declared your new class, you can begin overriding the virtual functions found in the Texture base class or in the DLLPlugin base class. You will need to override nearly every function in the base classs to have a completely functional new texture.

Definition at line 16 of file Texture.h.


Constructor & Destructor Documentation

Texture::Texture  )  [inline]
 

Definition at line 18 of file Texture.h.

Texture::Texture HTreeObject htreeobject  )  [inline]
 

Parameters:
htreeobject - is a pointer to the plugins owner. It is the class that the Texture is member of. It is the actual class you see in the PWS tree. The constructor only uses it to set the member variable m_treeobject. This member is used for ReAssignPtr. This is also the pointer returned by GetOwner().
See also:
DLLPlugin::DLLPlugin (HTreeObject *htreeobject)

Definition at line 19 of file Texture.h.


Member Function Documentation

void Texture::CheckOut HHashObject cache  )  [inline, virtual]
 

/note Don't use this function. It will be removed in a future version.

Definition at line 25 of file Texture.h.

BOOL Texture::Evaluate const Vector evalp,
HTexInfo texinfo
[pure virtual]
 

Every time a surface is encountered during rendering that has your texture on it, Evaluate is called. This gives you the ability to set what the surface's parameters are.

It is important to note that these textures are not "Shaders". The shading is still done after you have returned from Evaluate. You simply get to dictate what the surface is made of.

Parameters:
evalp - The 3D coordinate that you should evaluate is passed to you in the form of a Vector. This 3D coordinate is the coordinate as computed on the cached object surface. This means that the render time world coordinate on an object surface is reverse transformed to the cached surface. This prevents the texture from floating on the surface as the surface is being deformed from muscle or skeletal actions.
texinfo - All of the surface's parameters are sent to you in the texinfo variable. You may set any value in the HTexInfo.
See also:
HObjectCache for a description of cached objects.

BOOL Texture::EvaluateTransparency const Vector evalp,
HTexInfo texinfo
[pure virtual]
 

When a scene is rendered, it's done in two passes. The first pass determines what is visible, and the second pass shades the visible objects. During this first pass, it is not necessary to evaluate all of the textures. But it is important to know if something is transparent. So for speed's sake, we call another form of the Evaluate funcion, EvaluateTransparency. If your texture has no possible way of setting transparency, simply return TRUE. Otherwise write as little code as it takes to evaluate the transparency at the given evalp.

Note:
Don't worry about any other members of the TexInfo or Attr classes for this pass.
Parameters:
evalp - The 3D coordinate that you should evaluate is passed to you in the form of a Vector. This 3D coordinate is the coordinate as computed on the cached object surface. This means that the render time world coordinate on an object surface is reverse transformed to the cached surface. This prevents the texture from floating on the surface as the surface is being deformed from muscle or skeletal actions.
texinfo - All of the surface's parameters are sent to you in the texinfo variable. Don't worry about any other members of the TexInfo or Attr classes for this pass.
See also:
HObjectCache for a description of cached objects.

HGroup * Texture::GetGroup  ) 
 

Gets to that HGroup where the Texture instance is currently applied to.

The returned pointer may be NULL if the Texture is only part of a material or if the Texture is directly applied to the model and not to a group.

Note:
There may be several instances of a given Texture plugin. One on a material, one dropped on an object, one dropped on a group of an object. But also, when an object is dropped in a Choreography. In the cases where the Texture is dropped onto a group and then the model is dropped into a choreography, the two different Texture instances will receive different pointers. One HGroup* points to a HGroup on the cache object while the other points to the HGroup on the model instance that is dropped in the choreography. You can determine which is which by calling IsCache() of by repetitively calling GetParent() untill you reach an HOT_CHOR or ends to a NULL pointer.

HModel * Texture::GetModel  ) 
 

Gets to that HModel where the Texture instance is currently applied to.

The returned pointer may be NULL if the Texture is only part of a material.

Note:
There may be several instances of a given Texture plugin. One on a material, one dropped on an object, one dropped on a group of an object. But also, when an object is dropped in a Choreography. In the cases where the Texture is dropped onto a model and then the model is dropped into a choreography, the two different Texture instances will receive different pointers. One HModel* points to a cache object while the other points to the model instance that is dropped in the choreography. You can determine which is which by calling IsCache() of by repetitively calling GetParent() untill you reach an HOT_CHOR or ends to a NULL pointer.

HObjectListNode * Texture::GetPointerList HPointerPropertyBase *  prop  )  [inline, virtual]
 

When the user clicks on a HPointerProperty inside one of the properties defined by the plugin user interace, this function is called to retrieve the list of pointers to objects in the PWS that will be displayed in the drop-down list.

Parameters:
prop - points to one of the HPointerProperty defined in your plugin interface. You can use this pointer to determine which HPointerProperty the call relates to and decide what to fill the HObjectListNode with.
See also:
HPointerPropertyInfo and HPointerProperty

Definition at line 24 of file Texture.h.

void Texture::OnNotifyNewProperty HProperty prop,
const String matchname
[inline, virtual]
 

If your plugin allows the user to add custom properties, this function will be called the custom property is created, when the project is loaded or when additional instances of the plugin are later created. This allows you to save a poiner to the custom property for quick access when processing.

Definition at line 26 of file Texture.h.


The documentation for this class was generated from the following files:
This A:M SDK v12.0 documentation is maintained by Hash Inc. Please address any comments concerning this documentation to AMReports. If you have any information, knowledge, or documentation to share with the A:M developer community, please post them on the Hash SDK forum.

Generated on Thu Oct 27 11:47:03 2005 with doxygen 1.4.5 written by Dimitri van Heesch, © 1997-2001