Commit ca07a704 authored by hybrid's avatar hybrid

Constification for line3df paramater and reindentation.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2308 dfc29bdd-3216-0410-991c-e03cc46cb475
parent c2d6da34
......@@ -42,9 +42,8 @@ namespace scene
the scene node associated with the triangle that was hit.
\return True if a collision was detected and false if not. */
virtual bool getCollisionPoint(const core::line3d<f32>& ray,
ITriangleSelector* selector, core::vector3df& outCollisionPoint,
core::triangle3df& outTriangle,
const ISceneNode*& outNode) = 0;
ITriangleSelector* selector, core::vector3df& outCollisionPoint,
core::triangle3df& outTriangle, const ISceneNode*& outNode) =0;
//! Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid.
/** This can be used for moving a character in a 3d world: The
......@@ -132,8 +131,8 @@ namespace scene
\return Returns the scene node nearest to ray.start, which collides with the
ray and matches the idBitMask, if the mask is not null. If no scene
node is found, 0 is returned. */
virtual ISceneNode* getSceneNodeFromRayBB(const core::line3d<f32> ray,
s32 idBitMask=0, bool bNoDebugObjects = false) = 0;
virtual ISceneNode* getSceneNodeFromRayBB(const core::line3d<f32>& ray,
s32 idBitMask=0, bool bNoDebugObjects = false) =0;
//! Get the scene node, which the given camera is looking at and whose id matches the bitmask.
/** A ray is simply casted from the position of the camera to
......
This diff is collapsed.
#ifndef __C_SCENE_COLLISION_MANAGER_H_INCLUDED__
#define __C_SCENE_COLLISION_MANAGER_H_INCLUDED__
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_SCENE_COLLISION_MANAGER_H_INCLUDED__
#define __C_SCENE_COLLISION_MANAGER_H_INCLUDED__
#include "ISceneCollisionManager.h"
#include "ISceneManager.h"
#include "IVideoDriver.h"
......@@ -14,7 +14,7 @@ namespace irr
namespace scene
{
//! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes.
//! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes.
class CSceneCollisionManager : public ISceneCollisionManager
{
public:
......@@ -25,20 +25,20 @@ namespace scene
//! destructor
virtual ~CSceneCollisionManager();
//! Returns the scene node, which is currently visible under the overgiven
//! screencoordinates, viewed from the currently active camera.
virtual ISceneNode* getSceneNodeFromScreenCoordinatesBB(const core::position2d<s32> & pos,
s32 idBitMask=0, bool bNoDebugObjects = false);
//! Returns the scene node, which is currently visible at the given
//! screen coordinates, viewed from the currently active camera.
virtual ISceneNode* getSceneNodeFromScreenCoordinatesBB(const core::position2d<s32>& pos,
s32 idBitMask=0, bool bNoDebugObjects = false);
//! Returns the nearest scene node which collides with a 3d ray and
//! which id matches a bitmask.
virtual ISceneNode* getSceneNodeFromRayBB(const core::line3d<f32> ray,
s32 idBitMask=0, bool bNoDebugObjects = false);
//! Returns the nearest scene node which collides with a 3d ray and
//! which id matches a bitmask.
virtual ISceneNode* getSceneNodeFromRayBB(const core::line3d<f32>& ray,
s32 idBitMask=0, bool bNoDebugObjects = false);
//! Returns the scene node, at which the overgiven camera is looking at and
//! which id matches the bitmask.
virtual ISceneNode* getSceneNodeFromCameraBB(ICameraSceneNode* camera, s32 idBitMask=0,
bool bNoDebugObjects = false);
virtual ISceneNode* getSceneNodeFromCameraBB(ICameraSceneNode* camera,
s32 idBitMask=0, bool bNoDebugObjects = false);
//! Finds the collision point of a line and lots of triangles, if there is one.
virtual bool getCollisionPoint(const core::line3d<f32>& ray,
......@@ -47,11 +47,11 @@ namespace scene
const ISceneNode* & outNode);
//! Collides a moving ellipsoid with a 3d world with gravity and returns
//! the resulting new position of the ellipsoid.
//! the resulting new position of the ellipsoid.
virtual core::vector3df getCollisionResultPosition(
ITriangleSelector* selector,
const core::vector3df &ellipsoidPosition,
const core::vector3df& ellipsoidRadius,
const core::vector3df& ellipsoidRadius,
const core::vector3df& ellipsoidDirectionAndSpeed,
core::triangle3df& triout,
core::vector3df& hitPosition,
......@@ -82,12 +82,9 @@ namespace scene
private:
//! recursive method for going through all scene nodes
void getPickedNodeBB(ISceneNode* root,
core::line3df& ray,
s32 bits,
bool bNoDebugObjects,
f32& outbestdistance,
ISceneNode*& outbestnode);
void getPickedNodeBB(ISceneNode* root, core::line3df& ray, s32 bits,
bool bNoDebugObjects,
f32& outbestdistance, ISceneNode*& outbestnode);
//! recursive method for going through all scene nodes
void getPickedNodeFromBBAndSelector(ISceneNode * root,
......@@ -104,7 +101,7 @@ namespace scene
{
core::vector3df eRadius;
core::vector3df R3Velocity;
core::vector3df R3Velocity;
core::vector3df R3Position;
core::vector3df velocity;
......@@ -129,11 +126,11 @@ namespace scene
\param colData: the collision data.
\param triangle: the triangle to test against.
\return true if the triangle is hit (and is the closest hit), false otherwise */
bool testTriangleIntersection(SCollisionData* colData,
bool testTriangleIntersection(SCollisionData* colData,
const core::triangle3df& triangle);
//! recursive method for doing collision response
core::vector3df collideEllipsoidWithWorld(ITriangleSelector* selector,
core::vector3df collideEllipsoidWithWorld(ITriangleSelector* selector,
const core::vector3df &position,
const core::vector3df& radius, const core::vector3df& velocity,
f32 slidingSpeed,
......@@ -149,7 +146,7 @@ namespace scene
ISceneManager* SceneManager;
video::IVideoDriver* Driver;
core::array<core::triangle3df> Triangles; // triangle buffer
core::array<core::triangle3df> Triangles; // triangle buffer
};
......
......@@ -1161,8 +1161,8 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE
switch(time)
{
// take camera if it doesn't exists
case ESNRP_CAMERA:
// take camera if it is not already registered
case ESNRP_CAMERA:
{
taken = 1;
for ( u32 i = 0; i != CameraList.size(); ++i )
......@@ -1177,11 +1177,12 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE
{
CameraList.push_back(node);
}
}break;
}
break;
case ESNRP_LIGHT:
// TODO: Point Light culling..
// Lighting modell in irrlicht has to be redone..
// Lighting model in irrlicht has to be redone..
//if (!isCulled(node))
{
LightList.push_back(static_cast<ILightSceneNode*>(node));
......@@ -1268,6 +1269,7 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE
return taken;
}
//! This method is called just before the rendering process of the whole scene.
//! draws all scene nodes
void CSceneManager::drawAll()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment