mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:37:20 +02:00
Add simpler RayPick constructor with position/direction values set to default
This commit is contained in:
parent
14b3093506
commit
b68031b969
2 changed files with 6 additions and 2 deletions
|
@ -2271,8 +2271,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
|
|
||||||
// Setup the mouse ray pick and related operators
|
// Setup the mouse ray pick and related operators
|
||||||
{
|
{
|
||||||
auto mouseRayPick = std::make_shared<RayPick>(glm::vec3(), Vectors::UP,
|
auto mouseRayPick = std::make_shared<RayPick>(PickFilter(PickScriptingInterface::PICK_ENTITIES() | PickScriptingInterface::PICK_INCLUDE_NONCOLLIDABLE()), 0.0f, true);
|
||||||
PickFilter(PickScriptingInterface::PICK_ENTITIES() | PickScriptingInterface::PICK_INCLUDE_NONCOLLIDABLE()), 0.0f, true);
|
|
||||||
mouseRayPick->parentTransform = std::make_shared<MouseTransformNode>();
|
mouseRayPick->parentTransform = std::make_shared<MouseTransformNode>();
|
||||||
auto mouseRayPickID = DependencyManager::get<PickManager>()->addPick(PickQuery::Ray, mouseRayPick);
|
auto mouseRayPickID = DependencyManager::get<PickManager>()->addPick(PickQuery::Ray, mouseRayPick);
|
||||||
DependencyManager::get<EntityTreeRenderer>()->setMouseRayPickID(mouseRayPickID);
|
DependencyManager::get<EntityTreeRenderer>()->setMouseRayPickID(mouseRayPickID);
|
||||||
|
|
|
@ -70,6 +70,11 @@ public:
|
||||||
class RayPick : public Pick<PickRay> {
|
class RayPick : public Pick<PickRay> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
RayPick(const PickFilter& filter, float maxDistance, bool enabled) :
|
||||||
|
Pick(filter, maxDistance, enabled) {
|
||||||
|
_mathPick = PickRay(Vectors::ZERO, Vectors::UP);
|
||||||
|
}
|
||||||
|
|
||||||
RayPick(glm::vec3 position, glm::vec3 direction, const PickFilter& filter, float maxDistance, bool enabled) :
|
RayPick(glm::vec3 position, glm::vec3 direction, const PickFilter& filter, float maxDistance, bool enabled) :
|
||||||
Pick(filter, maxDistance, enabled) {
|
Pick(filter, maxDistance, enabled) {
|
||||||
_mathPick = PickRay(position, direction);
|
_mathPick = PickRay(position, direction);
|
||||||
|
|
Loading…
Reference in a new issue