15 #include "cLwoSurfaceBlockTMap.h"
16 #include "lwoToEggConverter.h"
18 #include "lwoSurfaceBlockTransform.h"
19 #include "lwoSurfaceBlockRefObj.h"
20 #include "compose_matrix.h"
28 CLwoSurfaceBlockTMap::
30 _converter(converter),
33 _center.set(0.0, 0.0, 0.0);
34 _size.set(1.0, 1.0, 1.0);
35 _rotation.set(0.0, 0.0, 0.0);
36 _csys = LwoSurfaceBlockCoordSys::T_object;
37 _reference_object =
"(none)";
40 int num_chunks = _tmap->get_num_chunks();
41 for (
int i = 0; i < num_chunks; i++) {
42 const IffChunk *chunk = _tmap->get_chunk(i);
44 if (chunk->
is_of_type(LwoSurfaceBlockTransform::get_class_type())) {
47 _center = trans->_vec;
51 _rotation = trans->_vec;
54 }
else if (chunk->
is_of_type(LwoSurfaceBlockRefObj::get_class_type())) {
56 _reference_object = ref->_name;
58 }
else if (chunk->
is_of_type(LwoSurfaceBlockCoordSys::get_class_type())) {
74 LPoint3d hpr(rad_2_deg(_rotation[0]),
75 rad_2_deg(-_rotation[1]),
76 rad_2_deg(-_rotation[2]));
77 compose_matrix(mat, LCAST(
double, _size), hpr,
78 LCAST(
double, _center), CS_yup_left);
This is a 4-by-4 transform matrix.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
The tMap chunk within a LwoSurfaceBlock chunk.
Specifies whether texture coordinates are computed based on the vertices' world coordinates or local ...
The basic kind of record in an EA "IFF" file, which the LightWave object file is based on...
void get_transform(LMatrix4d &mat) const
Fills up the indicated matrix with the net transform indicated by the TMAP chunk, accounting for scal...
IffId get_id() const
Returns the ID associated with this chunk.
This class supervises the construction of an EggData structure from the data represented by the LwoHe...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Specifies a reference object that the texture UV's are to be computed relative to.
A four-byte chunk ID appearing in an "IFF" file.