Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/ICmpVisual.h
Show All 21 Lines | |||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include "maths/BoundingBoxOriented.h" | #include "maths/BoundingBoxOriented.h" | ||||
#include "maths/BoundingBoxAligned.h" | #include "maths/BoundingBoxAligned.h" | ||||
#include "maths/Fixed.h" | #include "maths/Fixed.h" | ||||
#include "maths/FixedVector3D.h" | #include "maths/FixedVector3D.h" | ||||
#include "lib/file/vfs/vfs_path.h" | #include "lib/file/vfs/vfs_path.h" | ||||
#include <utility> | |||||
#include <vector> | |||||
#include <string> | |||||
class CUnit; | class CUnit; | ||||
struct JsProp | |||||
{ | |||||
CStr m_Name; | |||||
CFixedVector3D m_Position; | |||||
CFixedVector3D m_Rotation; | |||||
elexis: I would recommend to rename the `Js` name because the data is not specific to JS. | |||||
Done Inline ActionsWell it will only be used there, so I thought it made sense. Stan: Well it will only be used there, so I thought it made sense. | |||||
}; | |||||
/** | /** | ||||
* The visual representation of an entity (typically an actor). | * The visual representation of an entity (typically an actor). | ||||
*/ | */ | ||||
class ICmpVisual : public IComponent | class ICmpVisual : public IComponent | ||||
{ | { | ||||
public: | public: | ||||
/** | /** | ||||
* Get the world-space bounding box of the object's visual representation. | * Get the world-space bounding box of the object's visual representation. | ||||
Show All 30 Lines | public: | ||||
* Return the exact position where a projectile should be launched from (based on the actor's | * Return the exact position where a projectile should be launched from (based on the actor's | ||||
* ammo prop points). | * ammo prop points). | ||||
* Return type is CFixedVector3D because it is exposed to the JS interface. | * Return type is CFixedVector3D because it is exposed to the JS interface. | ||||
* Returns (0,0,0) if no point can be found. | * Returns (0,0,0) if no point can be found. | ||||
*/ | */ | ||||
virtual CFixedVector3D GetProjectileLaunchPoint() const = 0; | virtual CFixedVector3D GetProjectileLaunchPoint() const = 0; | ||||
/** | /** | ||||
* Return all the prop points an entity currently have with their location | |||||
* Return type is CFixedVector3D because it is exposed to the JS interface. | |||||
* Returns (0,0,0) if no point can be found. | |||||
*/ | |||||
virtual std::vector<JsProp> GetPropPoints() const = 0; | |||||
/** | |||||
* Returns the underlying unit of this visual actor. May return NULL to indicate that no unit exists (e.g. may happen if the | * Returns the underlying unit of this visual actor. May return NULL to indicate that no unit exists (e.g. may happen if the | ||||
* game is started without graphics rendering). | * game is started without graphics rendering). | ||||
* Originally intended for introspection purposes in Atlas; for other purposes, consider using a specialized getter first. | * Originally intended for introspection purposes in Atlas; for other purposes, consider using a specialized getter first. | ||||
Done Inline ActionsIt's not necessary to use the Fixed type for JS. elexis: It's not necessary to use the Fixed type for JS.
It is necessary to use the Fixed type for… | |||||
Done Inline ActionsIn this case since it will affect simulation it needs to fixed. Stan: In this case since it will affect simulation it needs to fixed. | |||||
*/ | */ | ||||
virtual CUnit* GetUnit() = 0; | virtual CUnit* GetUnit() = 0; | ||||
/** | /** | ||||
* Set the variant selection of the actor for a certain key. | * Set the variant selection of the actor for a certain key. | ||||
* This overrides a previous selection on that key, so every component | * This overrides a previous selection on that key, so every component | ||||
* should use unique keys. | * should use unique keys. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
I would recommend to rename the Js name because the data is not specific to JS.