mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
using the new ray casting implementation
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
#include <mesh.h>
|
||||
#include <model.h>
|
||||
#include <root.h>
|
||||
#include <ray.h>
|
||||
#include <rayCaster.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -97,9 +97,8 @@ namespace battleship{
|
||||
frame.update();
|
||||
|
||||
Vector3 startPos = Root::getSingleton()->getCamera()->getPosition();
|
||||
vector<Ray::CollisionResult> results;
|
||||
Ray::retrieveCollisions(startPos, (screenToSpace(getCursorPos()) - startPos).norm(), Map::getSingleton()->getNodeParent()->getChild(0), results);
|
||||
Ray::sortResults(results);
|
||||
vector<RayCaster::CollisionResult> results = RayCaster::cast(startPos, (screenToSpace(getCursorPos()) - startPos).norm(), Map::getSingleton()->getNodeParent()->getChild(0));
|
||||
|
||||
if(results.empty()) return;
|
||||
|
||||
Vector3 newPos, rowEnd;
|
||||
|
||||
Reference in New Issue
Block a user