|
|
@@ -22,291 +22,132 @@ $#include "StaticModel.h"
|
|
|
$#include "Terrain.h"
|
|
|
$#include "Zone.h"
|
|
|
|
|
|
-/// Component and child node creation mode for networking.
|
|
|
enum CreateMode
|
|
|
{
|
|
|
REPLICATED = 0,
|
|
|
LOCAL = 1
|
|
|
};
|
|
|
|
|
|
-/// %Scene node that may contain components and child nodes.
|
|
|
-class Node
|
|
|
+class Node : public Serializable
|
|
|
{
|
|
|
-public:
|
|
|
- /// Construct.
|
|
|
Node(Context* context);
|
|
|
- /// Destruct. Any child nodes are detached.
|
|
|
virtual ~Node();
|
|
|
-
|
|
|
- /// Set name.
|
|
|
+
|
|
|
+ bool SaveXML(Serializer& dest) const;
|
|
|
void SetName(const String& name);
|
|
|
- /// Set position relative to parent node.
|
|
|
void SetPosition(const Vector3& position);
|
|
|
- /// Set rotation relative to parent node.
|
|
|
void SetRotation(const Quaternion& rotation);
|
|
|
- /// Set direction relative to parent node. Positive Z equals identity.
|
|
|
void SetDirection(const Vector3& direction);
|
|
|
- /// Set uniform scale relative to parent node.
|
|
|
void SetScale(float scale);
|
|
|
- /// Set scale relative to parent node.
|
|
|
void SetScale(const Vector3& scale);
|
|
|
- /// Set transform relative to parent node.
|
|
|
void SetTransform(const Vector3& position, const Quaternion& rotation);
|
|
|
- /// Set transform relative to parent node.
|
|
|
void SetTransform(const Vector3& position, const Quaternion& rotation, float scale);
|
|
|
- /// Set transform relative to parent node.
|
|
|
void SetTransform(const Vector3& position, const Quaternion& rotation, const Vector3& scale);
|
|
|
- /// Set position relative to world space.
|
|
|
void SetWorldPosition(const Vector3& position);
|
|
|
- /// Set rotation relative to world space.
|
|
|
void SetWorldRotation(const Quaternion& rotation);
|
|
|
- /// Set direction relative to world space.
|
|
|
void SetWorldDirection(const Vector3& direction);
|
|
|
- /// Set uniform scale relative to world space.
|
|
|
void SetWorldScale(float scale);
|
|
|
- /// Set scale relative to world space.
|
|
|
void SetWorldScale(const Vector3& scale);
|
|
|
- /// Set transform relative to world space.
|
|
|
void SetWorldTransform(const Vector3& position, const Quaternion& rotation);
|
|
|
- /// Set transform relative to world space.
|
|
|
void SetWorldTransform(const Vector3& position, const Quaternion& rotation, float scale);
|
|
|
- /// Set transform relative to world space.
|
|
|
void SetWorldTransform(const Vector3& position, const Quaternion& rotation, const Vector3& scale);
|
|
|
- /// Move the scene node.
|
|
|
void Translate(const Vector3& delta);
|
|
|
- /// Move the scene node relative to its rotation.
|
|
|
void TranslateRelative(const Vector3& delta);
|
|
|
- /// Rotate the scene node.
|
|
|
+
|
|
|
void Rotate(const Quaternion& delta, bool fixedAxis = false);
|
|
|
- /// Rotate around the X axis.
|
|
|
void Pitch(float angle, bool fixedAxis = false);
|
|
|
- /// Rotate around the Y axis.
|
|
|
void Yaw(float angle, bool fixedAxis = false);
|
|
|
- /// Rotate around the Z axis.
|
|
|
void Roll(float angle, bool fixedAxis = false);
|
|
|
- /// Look at a target world position.
|
|
|
void LookAt(const Vector3& target, const Vector3& upAxis = Vector3::UP);
|
|
|
- /// Modify scale uniformly.
|
|
|
+
|
|
|
void Scale(float scale);
|
|
|
- /// Modify scale.
|
|
|
void Scale(const Vector3& scale);
|
|
|
- /// Set enabled/disabled state without recursion. Components in a disabled node become effectively disabled regardless of their own enable/disable state.
|
|
|
void SetEnabled(bool enable);
|
|
|
- /// Set enabled/disabled state with optional recursion.
|
|
|
void SetEnabled(bool enable, bool recursive);
|
|
|
- /// Set owner connection for networking.
|
|
|
void SetOwner(Connection* owner);
|
|
|
- /// Mark node and child nodes to need world transform recalculation. Notify listener components.
|
|
|
void MarkDirty();
|
|
|
- /// Create a child scene node (with specified ID if provided).
|
|
|
+
|
|
|
Node* CreateChild(const String& name = String::EMPTY, CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
- /// Add a child scene node.
|
|
|
+
|
|
|
void AddChild(Node* node);
|
|
|
- /// Remove a child scene node.
|
|
|
void RemoveChild(Node* node);
|
|
|
- /// Remove all child scene nodes.
|
|
|
void RemoveAllChildren();
|
|
|
- /// Create a component to this node (with specified ID if provided).
|
|
|
- Component* CreateComponent(ShortStringHash type, CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
- /// Create a component to this node if it does not exist already.
|
|
|
- Component* GetOrCreateComponent(ShortStringHash type, CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
-
|
|
|
- /// Remove a component from this node.
|
|
|
void RemoveComponent(Component* component);
|
|
|
- /// Remove the first component of specific type from this node.
|
|
|
- // void RemoveComponent(ShortStringHash type);
|
|
|
- tolua_outside void NodeRemoveComponent @ RemoveComponent(const char* type);
|
|
|
- /// Remove all components from this node.
|
|
|
+ void RemoveComponent(ShortStringHash type);
|
|
|
+ void RemoveComponent(const char* type);
|
|
|
+
|
|
|
void RemoveAllComponents();
|
|
|
- /// Clone scene node, components and child nodes. Return the clone.
|
|
|
+
|
|
|
Node* Clone(CreateMode mode = REPLICATED);
|
|
|
- /// Remove from the parent node. If no other shared pointer references exist, causes immediate deletion.
|
|
|
+
|
|
|
void Remove();
|
|
|
- /// Set parent scene node. Retains the world transform.
|
|
|
void SetParent(Node* parent);
|
|
|
- /// Set a user variable.
|
|
|
void SetVar(ShortStringHash key, const Variant& value);
|
|
|
- /// Add listener component that is notified of node being dirtied. Can either be in the same node or another.
|
|
|
void AddListener(Component* component);
|
|
|
- /// Remove listener component.
|
|
|
void RemoveListener(Component* component);
|
|
|
|
|
|
- /// Template version of creating a component.
|
|
|
// template <class T> T* CreateComponent(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
-
|
|
|
- AnimationController* CreateComponent<AnimationController> @ CreateAnimationController();
|
|
|
- AnimatedModel* CreateComponent<AnimatedModel> @ CreateAnimatedModel();
|
|
|
- Camera* CreateComponent<Camera> @ CreateCamera();
|
|
|
- CollisionShape* CreateComponent<CollisionShape> @ CreateCollisionShape();
|
|
|
- Constraint* CreateComponent<Constraint> @ CreateConstraint();
|
|
|
- DebugRenderer* CreateComponent<DebugRenderer> @ CreateDebugRenderer();
|
|
|
- DecalSet* CreateComponent<DecalSet> @ CreateDecalSet();
|
|
|
- Drawable* CreateComponent<Drawable> @ CreateDrawable();
|
|
|
- Light* CreateComponent<Light> @ CreateLight();
|
|
|
- Navigable* CreateComponent<Navigable> @ CreateNavigable();
|
|
|
- NavigationMesh* CreateComponent<NavigationMesh> @ CreateNavigationMesh();
|
|
|
- NetworkPriority* CreateComponent<NetworkPriority> @ CreateNetworkPriority();
|
|
|
- Octree* CreateComponent<Octree> @ CreateOctree();
|
|
|
- OffMeshConnection* CreateComponent<OffMeshConnection> @ CreateOffMeshConnection();
|
|
|
- PhysicsWorld* CreateComponent<PhysicsWorld> @ CreatePhysicsWorld();
|
|
|
- RigidBody* CreateComponent<RigidBody> @ CreateRigidBody();
|
|
|
- SmoothedTransform* CreateComponent<SmoothedTransform> @ CreateSmoothedTransform();
|
|
|
- SoundListener* CreateComponent<SoundListener> @ CreateSoundListener();
|
|
|
- SoundSource* CreateComponent<SoundSource> @ CreateSoundSource();
|
|
|
- StaticModel* CreateComponent<StaticModel> @ CreateStaticModel();
|
|
|
- Terrain* CreateComponent<Terrain> @ CreateTerrain();
|
|
|
- Zone* CreateComponent<Zone> @ CreateZone();
|
|
|
-
|
|
|
- AnimationController* CreateComponent<AnimationController> @ CreateAnimationController(CreateMode mode);
|
|
|
- AnimatedModel* CreateComponent<AnimatedModel> @ CreateAnimatedModel(CreateMode mode);
|
|
|
- Camera* CreateComponent<Camera> @ CreateCamera(CreateMode mode);
|
|
|
- CollisionShape* CreateComponent<CollisionShape> @ CreateCollisionShape(CreateMode mode);
|
|
|
- Constraint* CreateComponent<Constraint> @ CreateConstraint(CreateMode mode);
|
|
|
- DebugRenderer* CreateComponent<DebugRenderer> @ CreateDebugRenderer(CreateMode mode);
|
|
|
- DecalSet* CreateComponent<DecalSet> @ CreateDecalSet(CreateMode mode);
|
|
|
- Drawable* CreateComponent<Drawable> @ CreateDrawable(CreateMode mode);
|
|
|
- Light* CreateComponent<Light> @ CreateLight(CreateMode mode);
|
|
|
- Navigable* CreateComponent<Navigable> @ CreateNavigable(CreateMode mode);
|
|
|
- NavigationMesh* CreateComponent<NavigationMesh> @ CreateNavigationMesh(CreateMode mode);
|
|
|
- NetworkPriority* CreateComponent<NetworkPriority> @ CreateNetworkPriority(CreateMode mode);
|
|
|
- Octree* CreateComponent<Octree> @ CreateOctree(CreateMode mode);
|
|
|
- OffMeshConnection* CreateComponent<OffMeshConnection> @ CreateOffMeshConnection(CreateMode mode);
|
|
|
- PhysicsWorld* CreateComponent<PhysicsWorld> @ CreatePhysicsWorld(CreateMode mode);
|
|
|
- RigidBody* CreateComponent<RigidBody> @ CreateRigidBody(CreateMode mode);
|
|
|
- SmoothedTransform* CreateComponent<SmoothedTransform> @ CreateSmoothedTransform(CreateMode mode);
|
|
|
- SoundListener* CreateComponent<SoundListener> @ CreateSoundListener(CreateMode mode);
|
|
|
- SoundSource* CreateComponent<SoundSource> @ CreateSoundSource(CreateMode mode);
|
|
|
- StaticModel* CreateComponent<StaticModel> @ CreateStaticModel(CreateMode mode);
|
|
|
- Terrain* CreateComponent<Terrain> @ CreateTerrain(CreateMode mode);
|
|
|
- Zone* CreateComponent<Zone> @ CreateZone(CreateMode mode);
|
|
|
-
|
|
|
- AnimationController* CreateComponent<AnimationController> @ CreateAnimationController(CreateMode mode, unsigned id);
|
|
|
- AnimatedModel* CreateComponent<AnimatedModel> @ CreateAnimatedModel(CreateMode mode, unsigned id);
|
|
|
- Camera* CreateComponent<Camera> @ CreateCamera(CreateMode mode, unsigned id);
|
|
|
- CollisionShape* CreateComponent<CollisionShape> @ CreateCollisionShape(CreateMode mode, unsigned id);
|
|
|
- Constraint* CreateComponent<Constraint> @ CreateConstraint(CreateMode mode, unsigned id);
|
|
|
- DebugRenderer* CreateComponent<DebugRenderer> @ CreateDebugRenderer(CreateMode mode, unsigned id);
|
|
|
- DecalSet* CreateComponent<DecalSet> @ CreateDecalSet(CreateMode mode, unsigned id);
|
|
|
- Drawable* CreateComponent<Drawable> @ CreateDrawable(CreateMode mode, unsigned id);
|
|
|
- Light* CreateComponent<Light> @ CreateLight(CreateMode mode, unsigned id);
|
|
|
- Navigable* CreateComponent<Navigable> @ CreateNavigable(CreateMode mode, unsigned id);
|
|
|
- NavigationMesh* CreateComponent<NavigationMesh> @ CreateNavigationMesh(CreateMode mode, unsigned id);
|
|
|
- NetworkPriority* CreateComponent<NetworkPriority> @ CreateNetworkPriority(CreateMode mode, unsigned id);
|
|
|
- Octree* CreateComponent<Octree> @ CreateOctree(CreateMode mode, unsigned id);
|
|
|
- OffMeshConnection* CreateComponent<OffMeshConnection> @ CreateOffMeshConnection(CreateMode mode, unsigned id);
|
|
|
- PhysicsWorld* CreateComponent<PhysicsWorld> @ CreatePhysicsWorld(CreateMode mode, unsigned id);
|
|
|
- RigidBody* CreateComponent<RigidBody> @ CreateRigidBody(CreateMode mode, unsigned id);
|
|
|
- SmoothedTransform* CreateComponent<SmoothedTransform> @ CreateSmoothedTransform(CreateMode mode, unsigned id);
|
|
|
- SoundListener* CreateComponent<SoundListener> @ CreateSoundListener(CreateMode mode, unsigned id);
|
|
|
- SoundSource* CreateComponent<SoundSource> @ CreateSoundSource(CreateMode mode, unsigned id);
|
|
|
- StaticModel* CreateComponent<StaticModel> @ CreateStaticModel(CreateMode mode, unsigned id);
|
|
|
- Terrain* CreateComponent<Terrain> @ CreateTerrain(CreateMode mode, unsigned id);
|
|
|
- Zone* CreateComponent<Zone> @ CreateZone(CreateMode mode, unsigned id);
|
|
|
-
|
|
|
- /// Template version of getting or creating a component.
|
|
|
- // template <class T> T* GetOrCreateComponent(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
-
|
|
|
- /// Return ID.
|
|
|
- unsigned GetID() const { return id_; }
|
|
|
- /// Return name.
|
|
|
- const String& GetName() const { return name_; }
|
|
|
- /// Return name hash.
|
|
|
- StringHash GetNameHash() const { return nameHash_; }
|
|
|
- /// Return parent scene node.
|
|
|
- Node* GetParent() const { return parent_; }
|
|
|
- /// Return scene.
|
|
|
- Scene* GetScene() const { return scene_; }
|
|
|
- /// Return whether is enabled. Disables nodes effectively disable all their components.
|
|
|
- bool IsEnabled() const { return enabled_; }
|
|
|
- /// Return owner connection in networking.
|
|
|
- Connection* GetOwner() const { return owner_; }
|
|
|
- /// Return position relative to parent node.
|
|
|
- const Vector3& GetPosition() const { return position_; }
|
|
|
- /// Return rotation relative to parent node.
|
|
|
- const Quaternion& GetRotation() const { return rotation_; }
|
|
|
- /// Return direction relative to parent node. Identity rotation equals positive Z.
|
|
|
- Vector3 GetDirection() const { return rotation_ * Vector3::FORWARD; }
|
|
|
- /// Return scale relative to parent node.
|
|
|
- const Vector3& GetScale() const { return scale_; }
|
|
|
- /// Return transform matrix relative to parent node.
|
|
|
- Matrix3x4 GetTransform() const { return Matrix3x4(position_, rotation_, scale_); }
|
|
|
-
|
|
|
- /// Return position in world space.
|
|
|
- Vector3 GetWorldPosition() const
|
|
|
- {
|
|
|
- if (dirty_)
|
|
|
- UpdateWorldTransform();
|
|
|
-
|
|
|
- return worldTransform_.Translation();
|
|
|
- }
|
|
|
+ AnimationController* CreateComponent<AnimationController> @ CreateAnimationController(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ AnimatedModel* CreateComponent<AnimatedModel> @ CreateAnimatedModel(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ Camera* CreateComponent<Camera> @ CreateCamera(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ CollisionShape* CreateComponent<CollisionShape> @ CreateCollisionShape(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ Constraint* CreateComponent<Constraint> @ CreateConstraint(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ DebugRenderer* CreateComponent<DebugRenderer> @ CreateDebugRenderer(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ DecalSet* CreateComponent<DecalSet> @ CreateDecalSet(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ Drawable* CreateComponent<Drawable> @ CreateDrawable(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ Light* CreateComponent<Light> @ CreateLight(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ Navigable* CreateComponent<Navigable> @ CreateNavigable(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ NavigationMesh* CreateComponent<NavigationMesh> @ CreateNavigationMesh(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ NetworkPriority* CreateComponent<NetworkPriority> @ CreateNetworkPriority(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ Octree* CreateComponent<Octree> @ CreateOctree(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ OffMeshConnection* CreateComponent<OffMeshConnection> @ CreateOffMeshConnection(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ PhysicsWorld* CreateComponent<PhysicsWorld> @ CreatePhysicsWorld(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ RigidBody* CreateComponent<RigidBody> @ CreateRigidBody(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ SmoothedTransform* CreateComponent<SmoothedTransform> @ CreateSmoothedTransform(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ SoundListener* CreateComponent<SoundListener> @ CreateSoundListener(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ SoundSource* CreateComponent<SoundSource> @ CreateSoundSource(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ StaticModel* CreateComponent<StaticModel> @ CreateStaticModel(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ Terrain* CreateComponent<Terrain> @ CreateTerrain(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
+ Zone* CreateComponent<Zone> @ CreateZone(CreateMode mode = REPLICATED, unsigned id = 0);
|
|
|
|
|
|
- /// Return rotation in world space.
|
|
|
- Quaternion GetWorldRotation() const
|
|
|
- {
|
|
|
- if (dirty_)
|
|
|
- UpdateWorldTransform();
|
|
|
-
|
|
|
- return worldRotation_;
|
|
|
- }
|
|
|
+ unsigned GetID() const;
|
|
|
+ const String& GetName() const;
|
|
|
+ StringHash GetNameHash() const;
|
|
|
+ Node* GetParent() const;
|
|
|
+ Scene* GetScene() const;
|
|
|
+ bool IsEnabled() const;
|
|
|
+ Connection* GetOwner() const;
|
|
|
+ const Vector3& GetPosition() const;
|
|
|
+ const Quaternion& GetRotation() const;
|
|
|
+ Vector3 GetDirection() const;
|
|
|
+ const Vector3& GetScale() const;
|
|
|
+ Matrix3x4 GetTransform() const;
|
|
|
|
|
|
- /// Return direction in world space.
|
|
|
- Vector3 GetWorldDirection() const
|
|
|
- {
|
|
|
- if (dirty_)
|
|
|
- UpdateWorldTransform();
|
|
|
-
|
|
|
- return worldRotation_ * Vector3::FORWARD;
|
|
|
- }
|
|
|
-
|
|
|
- /// Return scale in world space.
|
|
|
- Vector3 GetWorldScale() const
|
|
|
- {
|
|
|
- if (dirty_)
|
|
|
- UpdateWorldTransform();
|
|
|
-
|
|
|
- return worldTransform_.Scale();
|
|
|
- }
|
|
|
-
|
|
|
- /// Return transform matrix in world space.
|
|
|
- const Matrix3x4& GetWorldTransform() const
|
|
|
- {
|
|
|
- if (dirty_)
|
|
|
- UpdateWorldTransform();
|
|
|
-
|
|
|
- return worldTransform_;
|
|
|
- }
|
|
|
-
|
|
|
- /// Convert a local space position to world space.
|
|
|
+ Vector3 GetWorldPosition() const;
|
|
|
+ Quaternion GetWorldRotation() const;
|
|
|
+ Vector3 GetWorldDirection() const;
|
|
|
+ Vector3 GetWorldScale() const;
|
|
|
+ const Matrix3x4& GetWorldTransform() const;
|
|
|
Vector3 LocalToWorld(const Vector3& position) const;
|
|
|
- /// Convert a local space position or rotation to world space.
|
|
|
Vector3 LocalToWorld(const Vector4& vector) const;
|
|
|
- /// Convert a world space position to local space.
|
|
|
Vector3 WorldToLocal(const Vector3& position) const;
|
|
|
- /// Convert a world space position or rotation to local space.
|
|
|
Vector3 WorldToLocal(const Vector4& vector) const;
|
|
|
- /// Return whether transform has changed and world transform needs recalculation.
|
|
|
- bool IsDirty() const { return dirty_; }
|
|
|
- /// Return number of child scene nodes.
|
|
|
+ bool IsDirty() const;
|
|
|
+
|
|
|
unsigned GetNumChildren(bool recursive = false) const;
|
|
|
- /// Return child scene node by index.
|
|
|
Node* GetChild(unsigned index) const;
|
|
|
- /// Return child scene node by name.
|
|
|
Node* GetChild(const String& name, bool recursive = false) const;
|
|
|
- /// Return child scene node by name.
|
|
|
Node* GetChild(const char* name, bool recursive = false) const;
|
|
|
- /// Return child scene node by name hash.
|
|
|
Node* GetChild(StringHash nameHash, bool recursive = false) const;
|
|
|
- /// Return number of components.
|
|
|
- unsigned GetNumComponents() const { return components_.Size(); }
|
|
|
- /// Return number of non-local components.
|
|
|
+
|
|
|
+ unsigned GetNumComponents() const;
|
|
|
unsigned GetNumNetworkComponents() const;
|
|
|
- /// Return component by type. If there are several, returns the first.
|
|
|
- // Component* GetComponent(ShortStringHash type) const;
|
|
|
- /// Return whether has a specific component.
|
|
|
- // bool HasComponent(ShortStringHash type) const;
|
|
|
- tolua_outside bool NodeHasComponent @ HasComponent(const char* type) const;
|
|
|
|
|
|
- /// Template version of returning a component by type.
|
|
|
+ bool HasComponent(ShortStringHash type) const;
|
|
|
+ bool HasComponent(const char* type) const;
|
|
|
+
|
|
|
+ const Variant& GetVar(ShortStringHash key) const;
|
|
|
+ const VariantMap& GetVars() const;
|
|
|
// template <class T> T* GetComponent() const;
|
|
|
AnimationController* GetComponent<AnimationController> @ GetAnimationController() const;
|
|
|
AnimatedModel* GetComponent<AnimatedModel> @ GetAnimatedModel() const;
|
|
|
@@ -330,18 +171,35 @@ public:
|
|
|
StaticModel* GetComponent<StaticModel> @ GetStaticModel() const;
|
|
|
Terrain* GetComponent<Terrain> @ GetTerrain() const;
|
|
|
Zone* GetComponent<Zone> @ GetZone() const;
|
|
|
-};
|
|
|
-
|
|
|
-${
|
|
|
-
|
|
|
-void NodeRemoveComponent(Node* node, const char* type)
|
|
|
-{
|
|
|
- return node->RemoveComponent(ShortStringHash(type));
|
|
|
-}
|
|
|
-
|
|
|
-bool NodeHasComponent(const Node* node, const char* type)
|
|
|
-{
|
|
|
- return node->HasComponent(ShortStringHash(type));
|
|
|
-}
|
|
|
+
|
|
|
+ void SetID(unsigned id);
|
|
|
+ void SetScene(Scene* scene);
|
|
|
+ void ResetScene();
|
|
|
+
|
|
|
+ bool Load(Deserializer& source, SceneResolver& resolver, bool loadChildren = true, bool rewriteIDs = false, CreateMode mode = REPLICATED);
|
|
|
+ bool LoadXML(const XMLElement& source, SceneResolver& resolver, bool loadChildren = true, bool rewriteIDs = false, CreateMode mode = REPLICATED);
|
|
|
|
|
|
-$}
|
|
|
+ Node* CreateChild(unsigned id, CreateMode mode);
|
|
|
+ void AddComponent(Component* component, unsigned id, CreateMode mode);
|
|
|
+
|
|
|
+ tolua_property__get_set unsigned ID;
|
|
|
+ tolua_property__get_set String& name;
|
|
|
+ tolua_readonly tolua_property__get_set StringHash nameHash;
|
|
|
+ tolua_property__get_set Node* parent;
|
|
|
+ tolua_property__get_set Scene* scene;
|
|
|
+ tolua_property__is_set bool enabled;
|
|
|
+ tolua_property__get_set Connection* owner;
|
|
|
+ tolua_property__get_set Vector3& position;
|
|
|
+ tolua_property__get_set Quaternion& rotation;
|
|
|
+ tolua_property__get_set Vector3 direction;
|
|
|
+ tolua_property__get_set Vector3& scale;
|
|
|
+ tolua_readonly tolua_property__get_set Matrix3x4 transform;
|
|
|
+ tolua_property__get_set Vector3 worldPosition;
|
|
|
+ tolua_property__get_set Quaternion worldRotation;
|
|
|
+ tolua_property__get_set Vector3 worldDirection;
|
|
|
+ tolua_property__get_set Vector3 worldScale;
|
|
|
+ tolua_readonly tolua_property__get_set Matrix3x4& worldTransform;
|
|
|
+ tolua_readonly tolua_property__is_set bool dirty;
|
|
|
+ tolua_readonly tolua_property__get_set unsigned numComponents;
|
|
|
+ tolua_readonly tolua_property__get_set unsigned numNetworkComponents;
|
|
|
+};
|