mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
allow mouse pointer to pick against collidable entities
This commit is contained in:
parent
81b770e9f2
commit
0dc5e7743f
2 changed files with 4 additions and 3 deletions
|
@ -2284,7 +2284,8 @@ 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>(Vectors::ZERO, Vectors::UP, PickFilter(PickScriptingInterface::PICK_ENTITIES() | PickScriptingInterface::PICK_INCLUDE_NONCOLLIDABLE()), 0.0f, true);
|
auto mouseRayPick = std::make_shared<RayPick>(Vectors::ZERO, Vectors::UP, PickFilter(PickScriptingInterface::PICK_ENTITIES() | PickScriptingInterface::PICK_INCLUDE_NONCOLLIDABLE() |
|
||||||
|
PickScriptingInterface::PICK_INCLUDE_COLLIDABLE()), 0.0f, true);
|
||||||
mouseRayPick->parentTransform = std::make_shared<MouseTransformNode>();
|
mouseRayPick->parentTransform = std::make_shared<MouseTransformNode>();
|
||||||
mouseRayPick->setJointState(PickQuery::JOINT_STATE_MOUSE);
|
mouseRayPick->setJointState(PickQuery::JOINT_STATE_MOUSE);
|
||||||
auto mouseRayPickID = DependencyManager::get<PickManager>()->addPick(PickQuery::Ray, mouseRayPick);
|
auto mouseRayPickID = DependencyManager::get<PickManager>()->addPick(PickQuery::Ray, mouseRayPick);
|
||||||
|
|
|
@ -455,7 +455,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
|
|
||||||
this.leftPointer = this.pointerManager.createPointer(false, PickType.Ray, {
|
this.leftPointer = this.pointerManager.createPointer(false, PickType.Ray, {
|
||||||
joint: "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND",
|
joint: "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND",
|
||||||
filter: Picks.PICK_OVERLAYS | Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_NONCOLLIDABLE,
|
filter: Picks.PICK_OVERLAYS | Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_NONCOLLIDABLE | Picks.PICK_INCLUDE_COLLIDABLE,
|
||||||
triggers: [{action: Controller.Standard.LTClick, button: "Focus"}, {action: Controller.Standard.LTClick, button: "Primary"}],
|
triggers: [{action: Controller.Standard.LTClick, button: "Focus"}, {action: Controller.Standard.LTClick, button: "Primary"}],
|
||||||
posOffset: getGrabPointSphereOffset(Controller.Standard.LeftHand, true),
|
posOffset: getGrabPointSphereOffset(Controller.Standard.LeftHand, true),
|
||||||
hover: true,
|
hover: true,
|
||||||
|
@ -466,7 +466,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
Keyboard.setLeftHandLaser(this.leftPointer);
|
Keyboard.setLeftHandLaser(this.leftPointer);
|
||||||
this.rightPointer = this.pointerManager.createPointer(false, PickType.Ray, {
|
this.rightPointer = this.pointerManager.createPointer(false, PickType.Ray, {
|
||||||
joint: "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND",
|
joint: "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND",
|
||||||
filter: Picks.PICK_OVERLAYS | Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_NONCOLLIDABLE,
|
filter: Picks.PICK_OVERLAYS | Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_NONCOLLIDABLE | Picks.PICK_INCLUDE_COLLIDABLE,
|
||||||
triggers: [{action: Controller.Standard.RTClick, button: "Focus"}, {action: Controller.Standard.RTClick, button: "Primary"}],
|
triggers: [{action: Controller.Standard.RTClick, button: "Focus"}, {action: Controller.Standard.RTClick, button: "Primary"}],
|
||||||
posOffset: getGrabPointSphereOffset(Controller.Standard.RightHand, true),
|
posOffset: getGrabPointSphereOffset(Controller.Standard.RightHand, true),
|
||||||
hover: true,
|
hover: true,
|
||||||
|
|
Loading…
Reference in a new issue