Daniele Bartolini 11 лет назад
Родитель
Сommit
c96b7ed385

+ 1 - 1
engine/core/math/plane.h

@@ -39,7 +39,7 @@ namespace crown
 /// @ingroup Math
 namespace plane
 {
-	/// Normalizes the plane @æ p and returns its result.
+	/// Normalizes the plane @a p and returns its result.
 	Plane& normalize(Plane& p);
 
 	/// Returns the signed distance between plane @a p and point @a point.

+ 1 - 1
engine/core/math/quaternion.h

@@ -37,7 +37,7 @@ namespace crown
 /// Negates the quaternion @a q and returns the result.
 Quaternion operator-(const Quaternion& q);
 
-/// Multiplies the quaternions @a and @a b. (i.e. rotates first by @a a then by @a b).
+/// Multiplies the quaternions @a a and @a b. (i.e. rotates first by @a a then by @a b).
 Quaternion operator*(Quaternion a, const Quaternion& b);
 
 /// Multiplies the quaternion @a a by the scalar @a k.

+ 1 - 1
engine/core/strings/dynamic_string.h

@@ -76,7 +76,7 @@ public:
 	/// Returns whether the string starts with the given @a s string.
 	bool starts_with(const char* s) const;
 
-	/// Returns wheterh the string ends with the given @æ s string.
+	/// Returns wheterh the string ends with the given @a s string.
 	bool ends_with(const char* s) const;
 
 	/// Returns the string hashed to string::murmur2_32.

+ 5 - 1
engine/device.h

@@ -108,6 +108,7 @@ struct Device
 		_height = height;
 	}
 
+	/// Returns the main window resolution.
 	void resolution(uint16_t& width, uint16_t& height)
 	{
 		width = _width;
@@ -117,10 +118,13 @@ struct Device
 	/// Updates all the subsystems
 	void update();
 
-	/// Renders the given @a world from the point of view of the given @æ camera.
+	/// Renders the given @a world from the point of view of the given @a camera.
 	void render_world(World* world, Camera* camera);
 
+	/// Creates a new world.
 	WorldId create_world();
+
+	/// Destroys the given @a world.
 	void destroy_world(WorldId world);
 
 	/// Returns the resource package with the given @a package_name name.

+ 5 - 2
engine/physics/actor.h

@@ -78,13 +78,16 @@ struct Actor
 	/// Returns the center of mass of the actor.
 	Vector3 center_of_mass() const;
 
-	/// Makes the actor subject to gravity
+	/// Enables gravity for the actor.
 	void enable_gravity();
 
-	/// Makes the actor unsubject to gravity
+	/// Disables gravity for the actor.
 	void disable_gravity();
 
+	/// Enables collision detection for the actor.
 	void enable_collision();
+
+	/// Disables collision detection for the actor.
 	void disable_collision();
 
 	/// Sets the collision filter of the actor.

+ 25 - 16
engine/physics/controller.h

@@ -48,29 +48,38 @@ class PhysicsControllerCallback;
 /// @ingroup Physics
 struct Controller
 {
-							Controller(const PhysicsResource* pr, SceneGraph& sg, int32_t node, PxPhysics* physics, PxControllerManager* manager);
-							~Controller();
+	Controller(const PhysicsResource* pr, SceneGraph& sg, int32_t node, PxPhysics* physics, PxControllerManager* manager);
+	~Controller();
 
-	void					move(const Vector3& pos);
-	void					set_height(float height);
+	/// Moves the controller to @a pos.
+	void move(const Vector3& pos);
 
-	bool					collides_up() const;
-	bool					collides_down() const;
-	bool					collides_sides() const;
+	/// Sets the contoller height.
+	void set_height(float height);
 
-	Vector3					position() const;
-	void					update();
+	/// Returns whether the contoller collides upwards.
+	bool collides_up() const;
 
-private:
+	/// Returns whether the controller collides downwards.
+	bool collides_down() const;
+
+	/// Returns whether the controller collides sidewards.
+	bool collides_sides() const;
+
+	/// Returns the position of the controller.
+	Vector3 position() const;
 
-	const PhysicsResource*	m_resource;
+	void update();
+
+private:
 
-	SceneGraph&				m_scene_graph;
-	int32_t					m_node;
-	PxControllerManager*	m_manager;
-	PxController*			m_controller;
-	PxU32					m_flags;
+	const PhysicsResource* m_resource;
 
+	SceneGraph& m_scene_graph;
+	int32_t m_node;
+	PxControllerManager* m_manager;
+	PxController* m_controller;
+	PxU32 m_flags;
 	PhysicsControllerCallback m_callback;
 };
 

+ 3 - 0
engine/physics/physics_world.h

@@ -85,7 +85,10 @@ public:
 	RaycastId create_raycast(CollisionMode::Enum mode, CollisionType::Enum filter);
 	void destroy_raycast(RaycastId id);
 
+	/// Returns the gravity.
 	Vector3 gravity() const;
+
+	/// Sets the gravity.
 	void set_gravity(const Vector3& g);
 
 	/// Finds all actors in the physics world that are in a particular shape (supported: spheres, capsules and boxes)

+ 1 - 1
engine/renderers/debug_line.h

@@ -46,7 +46,7 @@ struct DebugLine
 	/// Whether to enable @a depth_test
 	DebugLine(bool depth_test);
 
-	/// Adds a line from @start to @end with the given @a color.
+	/// Adds a line from @a start to @a end with the given @a color.
 	void add_line(const Color4& color, const Vector3& start, const Vector3& end);
 
 	/// Adds a sphere at @a center with the given @a radius and @a color.

+ 15 - 0
engine/renderers/mesh.h

@@ -41,16 +41,31 @@ struct Mesh
 {
 	Mesh(SceneGraph& sg, int32_t node, const MeshResource* mr);
 
+	/// Returns the local position of the mesh.
 	Vector3 local_position() const;
+
+	/// Returns the local rotation of the mesh.	
 	Quaternion local_rotation() const;
+
+	/// Returns the local pose of the mesh.
 	Matrix4x4 local_pose() const;
 
+	/// Returns the world position of the mesh.
 	Vector3 world_position() const;
+
+	/// Returns the world rotation of the mesh.
 	Quaternion world_rotation() const;
+
+	/// Returns the world pose of the mesh.
 	Matrix4x4 world_pose() const;
 
+	/// Sets the local position of the mesh.
 	void set_local_position(Unit* unit, const Vector3& pos);
+
+	/// Sets the local rotation of the mesh.
 	void set_local_rotation(Unit* unit, const Quaternion& rot);
+
+	/// Sets the local pose of the mesh.
 	void set_local_pose(Unit* unit, const Matrix4x4& pose);
 
 public:

+ 15 - 0
engine/renderers/sprite.h

@@ -48,16 +48,31 @@ struct Sprite
 {
 	Sprite(RenderWorld& render_world, SceneGraph& sg, int32_t node, const SpriteResource* sr);
 
+	/// Returns the local position of the sprite.
 	Vector3 local_position() const;
+
+	/// Returns the local rotation of the sprite.	
 	Quaternion local_rotation() const;
+
+	/// Returns the local pose of the sprite.
 	Matrix4x4 local_pose() const;
 
+	/// Returns the world position of the sprite.
 	Vector3 world_position() const;
+
+	/// Returns the world rotation of the sprite.
 	Quaternion world_rotation() const;
+
+	/// Returns the world pose of the sprite.
 	Matrix4x4 world_pose() const;
 
+	/// Sets the local position of the sprite.
 	void set_local_position(Unit* unit, const Vector3& pos);
+
+	/// Sets the local rotation of the sprite.
 	void set_local_rotation(Unit* unit, const Quaternion& rot);
+
+	/// Sets the local pose of the sprite.
 	void set_local_pose(Unit* unit, const Matrix4x4& pose);
 
 	void set_material(MaterialId id);

+ 25 - 0
engine/world/unit.h

@@ -86,23 +86,48 @@ struct Unit
 
 	const UnitResource*	resource() const;
 
+	/// Returns the node @a name.
 	int32_t node(const char* name) const;
+
+	/// Returns whether the unit has the node @a name.
 	bool has_node(const char* name) const;
+
+	/// Returns the number of nodes of the unit.
 	uint32_t num_nodes() const;
 
+	/// Returns the local position of the unit.
 	Vector3 local_position(int32_t node) const;
+
+	/// Returns the local rotation of the unit.
 	Quaternion local_rotation(int32_t node) const;
+
+	/// Returns the local pose of the unit.
 	Matrix4x4 local_pose(int32_t node) const;
 
+	/// Returns the world position of the unit.
 	Vector3 world_position(int32_t node) const;
+
+	/// Returns the world rotation of the unit.
 	Quaternion world_rotation(int32_t node) const;
+
+	/// Returns the world pose of the unit.
 	Matrix4x4 world_pose(int32_t node) const;
 
+	/// Sets the local position of the unit.
 	void set_local_position(int32_t node, const Vector3& pos);
+
+	/// Sets the local rotation of the unit.
 	void set_local_rotation(int32_t node, const Quaternion& rot);
+
+	/// Sets the local pose of the unit.
 	void set_local_pose(int32_t node, const Matrix4x4& pose);
 
+	/// Links the @a child node to the @a parent node.
+	/// After the linking the @a child pose is reset to identity.
+	/// @note The @a parent node must be either -1 (meaning no parent), or an index lesser than child.
 	void link_node(int32_t child, int32_t parent);
+
+	/// Unlinks @a child from its parent, if any.
 	void unlink_node(int32_t child);
 
 	void update();

+ 8 - 4
engine/world/world.h

@@ -108,7 +108,7 @@ public:
 	/// Destroys the camera @a id.
 	void destroy_camera(CameraId id);
 
-	/// Plays the sound with the given @æ name at the given @a position, with the given
+	/// Plays the sound with the given @a name at the given @a position, with the given
 	/// @a volume and @a range. @a loop controls whether the sound must loop or not.
 	SoundInstanceId play_sound(const char* name, bool loop = false, float volume = 1.0f, const Vector3& position = vector3::ZERO, float range = 50.0f);
 	SoundInstanceId play_sound(ResourceId id, const bool loop, const float volume, const Vector3& pos, const float range);
@@ -117,8 +117,8 @@ public:
 	/// Stops the sound with the given @a id.
 	void stop_sound(SoundInstanceId id);
 
-	/// Links the sound @a if to the @a node of the given @æ unit.
-	/// After this call, the sound @a id will follow the unit @æ unit.
+	/// Links the sound @a id to the @a node of the given @a unit.
+	/// After this call, the sound @a id will follow the unit @a unit.
 	void link_sound(SoundInstanceId id, Unit* unit, int32_t node);
 
 	/// Sets the @a pose of the listener.
@@ -133,7 +133,7 @@ public:
 	/// Sets the @a volume of the sound @a id.
 	void set_sound_volume(SoundInstanceId id, float volume);
 
-	/// Creates a new window-space Gui of size @width and @a height.
+	/// Creates a new window-space Gui of size @a width and @a height.
 	GuiId create_window_gui(uint16_t width, uint16_t height, const char* material);
 
 	/// Destroys the gui with the given @a id.
@@ -142,7 +142,11 @@ public:
 	/// Returns the gui @a id.
 	Gui* get_gui(GuiId id);
 
+	/// Creates a new DebugLine. @a depth_test controls whether to
+	/// enable depth test when rendering the lines.
 	DebugLine* create_debug_line(bool depth_test);
+
+	/// Destroys the debug @a line.
 	void destroy_debug_line(DebugLine* line);
 
 	/// Loads the level @a name into the world.