39#define MOUSE_GRAB_FORCE 30000.0f
56 MaterialPtr pickLineMaterial = MaterialManager::getSingleton().getByName(
"PickLineMaterial", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
57 if (!pickLineMaterial)
59 pickLineMaterial = MaterialManager::getSingleton().create(
"PickLineMaterial", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
61 pickLineMaterial->setReceiveShadows(
false);
62 pickLineMaterial->getTechnique(0)->setLightingEnabled(
true);
63 pickLineMaterial->getTechnique(0)->getPass(0)->setDiffuse(0, 0, 1, 0);
64 pickLineMaterial->getTechnique(0)->getPass(0)->setAmbient(0, 0, 1);
65 pickLineMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(0, 0, 1);
67 pickLine->begin(
"PickLineMaterial", RenderOperation::OT_LINE_LIST);
136 std::pair<bool, Real> pair = mouseRay.intersects(actor->ar_bounding_box);
140 for (
int j = 0; j < actor->ar_num_nodes; j++)
142 if (actor->ar_nodes[j].nd_no_mouse_grab)
146 std::pair<bool, Real> pair = mouseRay.intersects(Sphere(actor->ar_nodes[j].AbsPosition, 0.1f));
168 if (it->hk_hook_node->pos ==
minnode)
237 if (ms.buttonDown(OIS::MB_Middle))
252 Real nearest_ray_distance = std::numeric_limits<float>::max();
256 if (actor != player_actor)
258 Vector3 pos = actor->getPosition();
259 std::pair<bool, Real> pair = mouseRay.intersects(Sphere(pos, actor->getMinCameraRadius()));
262 Real ray_distance = mouseRay.getDirection().crossProduct(pos - mouseRay.getOrigin()).length();
263 if (ray_distance < nearest_ray_distance)
265 nearest_ray_distance = ray_distance;
276 Real nearest_camera_distance = std::numeric_limits<float>::max();
277 Real nearest_ray_distance = std::numeric_limits<float>::max();
283 std::pair<bool, Real> pair = mouseRay.intersects(Sphere(pos, 0.25f));
286 Real ray_distance = mouseRay.getDirection().crossProduct(pos - mouseRay.getOrigin()).length();
287 if (ray_distance < nearest_ray_distance || (ray_distance == nearest_ray_distance && pair.second < nearest_camera_distance))
289 nearest_camera_distance = pair.second;
290 nearest_ray_distance = ray_distance;
Central state/object manager and communications hub.
Game state manager and message-queue provider.
Mouse interaction with 3D scene.
NodeNum_t ar_custom_camera_node
Sim state; custom tracking node for 3rd-person camera.
void mouseMove(NodeNum_t node, Ogre::Vector3 pos, float force)
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
void calculateAveragePosition()
std::vector< hook_t > ar_hooks
ActorPtrVec & GetActors()
void NotifyContextChange()
@ CAMERA_BEHAVIOR_VEHICLE
Ogre::Camera * GetCamera()
const ActorPtr & GetPlayerActor()
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
ActorManager * GetActorManager()
NodeSB * GetSimNodeBuffer()
Ogre::SceneManager * GetSceneManager()
Ogre::SceneNode * pickLineNode
Ogre::ManualObject * pickLine
bool handleMousePressed()
Ogre::Vector3 lastgrabpos
bool handleMouseReleased()
@ EDITOR_MODE
Hacky, but whatever... added by Ulteq, 2016.
@ MSG_SIM_ACTOR_LINKING_REQUESTED
Payload = RoR::ActorLinkingRequest* (owner)
@ MSG_SIM_SEAT_PLAYER_REQUESTED
Payload = RoR::ActorPtr (owner) | nullptr.
@ LOCAL_SIMULATED
simulated (local) actor
InputEngine * GetInputEngine()
CameraManager * GetCameraManager()
GameContext * GetGameContext()
static const NodeNum_t NODENUM_INVALID
RefCountingObjectPtr< Actor > ActorPtr
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
Estabilishing a physics linkage between 2 actors modifies a global linkage table and triggers immedia...
ActorLinkingRequestType alr_type
ActorInstanceID_t alr_actor_instance_id
NodeNum_t alr_hook_mousenode
Unified game event system - all requests and state changes are reported using a message.
Ogre::Vector3 AbsPosition
Ogre::Vector3 AbsPosition
absolute position in the world (shaky)