mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-01 15:50:27 +02:00
Reformat the code, using:
find -type f | # list all regular files grep -E '\.(h|cpp|mm)$' | # filter for source files grep -v '/mt_' | # filter out generated files grep -v '/vendor/' | # and vendored GL grep -v '/test/image_loader_test.cpp' | # and this file (has giant literals arrays) xargs -n 1 -P $(nproc) clang-format -i # reformat everything Co-authored-by: numzero <numzer0@yandex.ru>
This commit is contained in:
@ -15,18 +15,17 @@ namespace scene
|
||||
{
|
||||
|
||||
//! constructor
|
||||
CSceneCollisionManager::CSceneCollisionManager(ISceneManager* smanager, video::IVideoDriver* driver)
|
||||
: SceneManager(smanager), Driver(driver)
|
||||
CSceneCollisionManager::CSceneCollisionManager(ISceneManager *smanager, video::IVideoDriver *driver) :
|
||||
SceneManager(smanager), Driver(driver)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CSceneCollisionManager");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (Driver)
|
||||
Driver->grab();
|
||||
}
|
||||
|
||||
|
||||
//! destructor
|
||||
CSceneCollisionManager::~CSceneCollisionManager()
|
||||
{
|
||||
@ -34,12 +33,11 @@ CSceneCollisionManager::~CSceneCollisionManager()
|
||||
Driver->drop();
|
||||
}
|
||||
|
||||
|
||||
//! Returns a 3d ray which would go through the 2d screen coordinates.
|
||||
core::line3d<f32> CSceneCollisionManager::getRayFromScreenCoordinates(
|
||||
const core::position2d<s32> & pos, const ICameraSceneNode* camera)
|
||||
const core::position2d<s32> &pos, const ICameraSceneNode *camera)
|
||||
{
|
||||
core::line3d<f32> ln(0,0,0,0,0,0);
|
||||
core::line3d<f32> ln(0, 0, 0, 0, 0, 0);
|
||||
|
||||
if (!SceneManager)
|
||||
return ln;
|
||||
@ -50,20 +48,20 @@ core::line3d<f32> CSceneCollisionManager::getRayFromScreenCoordinates(
|
||||
if (!camera)
|
||||
return ln;
|
||||
|
||||
const scene::SViewFrustum* f = camera->getViewFrustum();
|
||||
const scene::SViewFrustum *f = camera->getViewFrustum();
|
||||
|
||||
core::vector3df farLeftUp = f->getFarLeftUp();
|
||||
core::vector3df lefttoright = f->getFarRightUp() - farLeftUp;
|
||||
core::vector3df uptodown = f->getFarLeftDown() - farLeftUp;
|
||||
|
||||
const core::rect<s32>& viewPort = Driver->getViewPort();
|
||||
const core::rect<s32> &viewPort = Driver->getViewPort();
|
||||
core::dimension2d<u32> screenSize(viewPort.getWidth(), viewPort.getHeight());
|
||||
|
||||
f32 dx = pos.X / (f32)screenSize.Width;
|
||||
f32 dy = pos.Y / (f32)screenSize.Height;
|
||||
|
||||
if (camera->isOrthogonal())
|
||||
ln.start = f->cameraPosition + (lefttoright * (dx-0.5f)) + (uptodown * (dy-0.5f));
|
||||
ln.start = f->cameraPosition + (lefttoright * (dx - 0.5f)) + (uptodown * (dy - 0.5f));
|
||||
else
|
||||
ln.start = f->cameraPosition;
|
||||
|
||||
|
Reference in New Issue
Block a user