6#if !defined(AFX_MATERIALMAP_H__57174DE1_C363_11D3_AC9D_F94D2C3E2938__INCLUDED_)
7#define AFX_MATERIALMAP_H__57174DE1_C363_11D3_AC9D_F94D2C3E2938__INCLUDED_
17#ifndef MOOTOOLS_NO_BITMAP
21BEGIN_MOOTOOLS_NAMESPACE
27 MAPTYPE_UNDEFINED = 0,
39 MAPTYPE_SPECULAR_COLOR,
40 MAPTYPE_SPECULAR_ALPHA,
47 MAPTYPE_MIXED = MAPTYPE_LAST+10,
54 MAPPROJ_UNDEFINED = 0,
78 MAPPROP_NO_REPEAT_ON_U = 0x01,
79 MAPPROP_NO_REPEAT_ON_V = 0x02,
86#define KEYFRAME_MAP_TILE KEYFRAMEID(C3DKeyframe::KEYFRAME_TYPE_VECTOR, MAKE_CUSTOM_ID('M', 'P', 'T', 'L'))
87#define KEYFRAME_MAP_SWAPMATRIX KEYFRAMEID(C3DKeyframe::KEYFRAME_TYPE_MATRIX, MAKE_CUSTOM_ID('M', 'P', 'S', 'W'))
97 friend class CMaterialMapCache;
102 MATERIALMAP_ANY_SIZE = -1,
103 MATERIALMAP_DEFAULT_SIZE = 0,
108 MAPCHANNEL_UNSPECIFIED = (
unsigned int) - 1,
110 MAPCHANNEL_FIRST_CHANNEL_FOUND = 0x01,
120 unsigned int frontChannelFlags, backChannelFlags;
125 typedef struct MapPathPair
134 this->mainPath = path;
135 this->alphaPath = alphaPath;
136 this->mainPath.MakeLower();
137 this->alphaPath.MakeLower();
143#ifndef MOOTOOLS_NO_BITMAP
146 typedef struct MapBitmap
164 virtual ~MapBitmap();
176 typedef struct MapBitmap
208#ifndef MOOTOOLS_NO_BITMAP
272 void SetFileName(
const CXString& filename);
275 void ResetTransformation();
278 void SetTranslation(
unsigned int time,
const C3DVector&
vect);
283 void SetMatrix(
unsigned int time,
const C4x4Matrix& matrix);
297 void GetTranslation(
unsigned int time,
C3DVector&
vect)
const;
298 void GetHPBRotation(
unsigned int time,
C3DVector&
vect)
const;
304 void SwapCoordinates(
unsigned int swapmode);
307END_MOOTOOLS_NAMESPACE
C3DKeyframable class for handling keyframes.
MapProjection
Projection type of the texture map.
Definition MaterialMap.h:53
@ MAPPROJ_PLANAR
The following projection means that the mapping mode requires UVW to be generated as it is a mapping ...
Definition MaterialMap.h:56
@ MAPPROJ_CUBIC
Lightwave cubic mode (front/top/right normal - back/bottom/left inverted projection)
Definition MaterialMap.h:59
@ MAPPROJ_CUBIC2
C4D cubic mode (no inverted projection)
Definition MaterialMap.h:60
@ MAPPROJ_UVW
A CUVWChannel is required for the map.
Definition MaterialMap.h:55
MapType
This enum allows to know the kind of texture map.
Definition MaterialMap.h:26
MapAxis
Axis direction of the mapping projection.
Definition MaterialMap.h:67
MAP_PROPERTIES
Different flags for the map.
Definition MaterialMap.h:76
@ MAPPROP_DISABLE_ALPHA
Don't use alpha channel if there is any.
Definition MaterialMap.h:80
@ MAPPROP_INVALIDATE
Something changed for the map. Try to load again the bitmap.
Definition MaterialMap.h:83
CXTString< TCHAR > CXString
CXString depend on the target OS. Could be CXStringW (Windows) or CXStringA (Linux / Macos)
Definition XString.h:118
This is the base class for any object that can be animated using C3DKeyframe.
Definition 3DAnimatable.h:51
C3DMaterial is the base class for materials. There is currently two kinds of materials: C3DPbrMateria...
Definition 3DMaterial.h:69
The class allows to get access to the scene graph, node hierarchy, material.
Definition 3DScene.h:306
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
CCustomData is a handly class for storing any kind of data.
Definition CustomData.h:106
CMaterialMap handles material texture map.
Definition MaterialMap.h:95
C3DScene * GetScene() const
Return scene to which the map belong to (from C3DMaterials)
fileuint GetFileSize(bool alpha=false)
The file size of the source bitmap which might differ from the size of the requested bitmap.
CXString AdjustPath(CXString filename, const CXString &newTargetPath=CXString(), bool allowRelative=true) const
Adjust a single filename and make it relative to newTargetPath if provided or the scene path otherwis...
bool BitmapFileExists(bool alpha=false)
Check if the bitmap file exists.
CXString GetBitmapPath(bool alpha, bool fullPath=false) const
fullPath = true ensure that we have no relative path, otherwise the path might be relative to the sce...
MaterialMapSize
Definition MaterialMap.h:101
MapChannelFlags
Definition MaterialMap.h:107
void AdjustPaths(const CXString &targetPath, bool relativePathAllowed)
Make all internal filenames used by materials relative to provided path.
void GetFileName(CXString &filename) const
This returns the raw image filename as it is stored in the map, when reading a file....
void ChangeChannelID(CHashMap< CChannelInfo, const CChannelInfo &, CChannelInfo > &channelMap)
Remap the materialmap channel ID to the new channelID provided by the map.
bool HasAlpha()
Check if the map bitmap file has an alpha channel (if MAPPROP_DISABLE_ALPHA not set)
void GetAlphaFileName(CXString &filename) const
Same as GetFileName, but for the alpha image.
void SetAlphaFileName(const CXString &filename, const CXString &newReferencePath=CXString())
operator If newReferencePath is provided, the filename will be make relative to that directory if pos...
C3DMaterial * GetMaterial() const
Return the material to which the map is attached.
void SetChannelID(ChannelID uvwChannelID, bool front=true, unsigned int channelFlags=MAPCHANNEL_UNSPECIFIED)
Handle the channel id of the material map. The corresponding channel is an UVW_CHANNEL.
ChannelID GetChannelID(bool front=true, unsigned int *channelFlags=NULL) const
Return the material map channel ID, as set in SetChannelID (the flag MAPPROP_USE_FRONT_CHANNEL_WHEN_B...
The class defines a quaternion transformation.
Definition Quaternion.h:20