ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

This resource represents the floor of a 3D layer. More...

#include <floor.h>

Inheritance diagram for Stark::Resources::Floor:
Collaboration diagram for Stark::Resources::Floor:

List of all members.

Public Member Functions

 Floor (Object *parent, byte subType, uint16 index, const Common::String &name)
virtual ~Floor ()
void onAllLoaded () override
 Called when the resource sub-tree is entirely loaded.
void saveLoad (ResourceSerializer *serializer) override
 Persist / restore the resource state.
Math::Vector3d getVertex (uint32 index) const
 Obtain the vertex for an index.
int32 findFaceContainingPoint (const Math::Vector3d &point) const
 Obtain the index of the face containing the point when both the floorfield and the point are projected on a Z=0 plane.
void computePointHeightInFace (Math::Vector3d &point, uint32 faceIndex) const
 Fill the z coordinate of the point so that it is on the plane of a face.
int32 findFaceHitByRay (const Math::Ray &ray, Math::Vector3d &intersection) const
 Check if a ray is intersecting the floor.
int32 findFaceClosestToRay (const Math::Ray &ray, Math::Vector3d &center) const
 Find the floor face center closest to the ray.
float getDistanceFromCamera (uint32 faceIndex) const
 Obtain the distance to the camera for a face.
FloorFacegetFace (uint32 index) const
 Get a floor face by its index.
bool isSegmentInside (const Math::Line3d &segment) const
 Check if the segment is entirely inside the floor.
void enableFloorField (FloorField *floorfield, bool enable)
 Allow or disallow characters to walk on some faces of the floor.

Static Public Attributes

static const Type::ResourceType TYPE = Type::kFloor

Protected Member Functions

void readData (Formats::XRCReadStream *stream) override
 Deserialize the resource static data and initial state.
void printData () override
void buildEdgeList ()
void addFaceEdgeToList (uint32 faceIndex, uint32 index1, uint32 index2)

Protected Attributes

uint32 _facesCount
Common::Array< Math::Vector3d_vertices
Common::Array< FloorFace * > _faces
Common::Array< FloorEdge_edges

Detailed Description

This resource represents the floor of a 3D layer.

Characters can only walk on the floor.

The floor is made of a list of faces building a mesh.

Definition at line 125 of file floor.h.


Constructor & Destructor Documentation

Stark::Resources::Floor::Floor ( Object parent,
byte  subType,
uint16  index,
const Common::String name 
)

Definition at line 37 of file floor.cpp.

Stark::Resources::Floor::~Floor (  )  [virtual]

Definition at line 43 of file floor.cpp.


Member Function Documentation

void Stark::Resources::Floor::addFaceEdgeToList ( uint32  faceIndex,
uint32  index1,
uint32  index2 
) [protected]

Definition at line 192 of file floor.cpp.

void Stark::Resources::Floor::buildEdgeList (  )  [protected]

Definition at line 159 of file floor.cpp.

void Stark::Resources::Floor::computePointHeightInFace ( Math::Vector3d point,
uint32  faceIndex 
) const

Fill the z coordinate of the point so that it is on the plane of a face.

Definition at line 60 of file floor.cpp.

void Stark::Resources::Floor::enableFloorField ( FloorField floorfield,
bool  enable 
)

Allow or disallow characters to walk on some faces of the floor.

Definition at line 209 of file floor.cpp.

int32 Stark::Resources::Floor::findFaceClosestToRay ( const Math::Ray ray,
Math::Vector3d center 
) const

Find the floor face center closest to the ray.

Faces where walking is disabled are ignored.

Parameters:
ray The ray
center The closest face center to the ray. Only valid when the return value is positive.
Returns:
-1 if no face was found, the face index with its center closest to the ray otherwise

Definition at line 79 of file floor.cpp.

int32 Stark::Resources::Floor::findFaceContainingPoint ( const Math::Vector3d point  )  const

Obtain the index of the face containing the point when both the floorfield and the point are projected on a Z=0 plane.

Return -1 if no face contains the point.

Definition at line 50 of file floor.cpp.

int32 Stark::Resources::Floor::findFaceHitByRay ( const Math::Ray ray,
Math::Vector3d intersection 
) const

Check if a ray is intersecting the floor.

Faces where walking is disabled are ignored.

Parameters:
ray The ray
intersection The intersection between the ray and the floor. Only valid when the return value is positive.
Returns:
-1 if no face contains the point, the hit face index otherwise

Definition at line 64 of file floor.cpp.

float Stark::Resources::Floor::getDistanceFromCamera ( uint32  faceIndex  )  const

Obtain the distance to the camera for a face.

Definition at line 101 of file floor.cpp.

FloorFace * Stark::Resources::Floor::getFace ( uint32  index  )  const

Get a floor face by its index.

Definition at line 106 of file floor.cpp.

Math::Vector3d Stark::Resources::Floor::getVertex ( uint32  index  )  const

Obtain the vertex for an index.

Definition at line 46 of file floor.cpp.

bool Stark::Resources::Floor::isSegmentInside ( const Math::Line3d segment  )  const

Check if the segment is entirely inside the floor.

Definition at line 110 of file floor.cpp.

void Stark::Resources::Floor::onAllLoaded (  )  [override, virtual]

Called when the resource sub-tree is entirely loaded.

Allows to load data from other nodes.

Reimplemented from Stark::Resources::Object.

Definition at line 145 of file floor.cpp.

void Stark::Resources::Floor::printData (  )  [override, protected, virtual]

Reimplemented from Stark::Resources::Object.

Definition at line 217 of file floor.cpp.

void Stark::Resources::Floor::readData ( Formats::XRCReadStream stream  )  [override, protected, virtual]

Deserialize the resource static data and initial state.

Reimplemented from Stark::Resources::Object.

Definition at line 135 of file floor.cpp.

void Stark::Resources::Floor::saveLoad ( ResourceSerializer serializer  )  [override, virtual]

Persist / restore the resource state.

Reimplemented from Stark::Resources::Object.

Definition at line 153 of file floor.cpp.


Member Data Documentation

Definition at line 194 of file floor.h.

Definition at line 193 of file floor.h.

Definition at line 191 of file floor.h.

const Type::ResourceType Stark::Resources::Floor::TYPE = Type::kFloor [static]

Definition at line 127 of file floor.h.


The documentation for this class was generated from the following files:


Generated on Sat Mar 16 2019 05:07:03 for ResidualVM by doxygen 1.7.1
curved edge   curved edge