|
Johnthe Finesmith
Registered User
Join date: 2 Jun 2008
Posts: 10
|
04-16-2009 00:52
I am trying to build a laser firing satellite that will be physical, hover at a certain altitude. I have that part down for the most part, but I can't figure out how to make it use signals from a different prim that uses the users mouselook and click to send signals to the satellites gun to aim and fire. I can't even figure out how to make the avatars mouselook use the gun as its camera.
|
|
Tanith Rosenbaum
Registered User
Join date: 10 Sep 2008
Posts: 42
|
04-16-2009 01:53
From: Johnthe Finesmith I am trying to build a laser firing satellite that will be physical, hover at a certain altitude. I have that part down for the most part, but I can't figure out how to make it use signals from a different prim that uses the users mouselook and click to send signals to the satellites gun to aim and fire. I can't even figure out how to make the avatars mouselook use the gun as its camera. You can force an avatar into mouse look with llForceMouselook. My teh first thing I'd try would be to use llGetCameraRot to determine the direction the camera points. And once you got that you'll have to determine what the laser would hit. thats a bit tricky, you'd need to get your avatar height, and then calculate the point they're looking at geometrically from height and angle. or, and that's maybe quite a bit more simple, have the control prim shoot an invisible probe/bullet towards where the avatar is looking, for the sole purpose to determine teh point where it collides with something. And lastly use chat to trasmit the target position vector you determined (in region coordiunates) up to your satellite and have it shoot at that spot ^^ that's what I'd try, haven't done so though, so take this as idea, not as solid and 100% guaranteed-to-work knowledge please
|
|
Johnthe Finesmith
Registered User
Join date: 2 Jun 2008
Posts: 10
|
04-16-2009 02:21
From: Tanith Rosenbaum You can force an avatar into mouse look with llForceMouselook. My teh first thing I'd try would be to use llGetCameraRot to determine the direction the camera points. And once you got that you'll have to determine what the laser would hit. thats a bit tricky, you'd need to get your avatar height, and then calculate the point they're looking at geometrically from height and angle. or, and that's maybe quite a bit more simple, have the control prim shoot an invisible probe/bullet towards where the avatar is looking, for the sole purpose to determine teh point where it collides with something. And lastly use chat to trasmit the target position vector you determined (in region coordiunates) up to your satellite and have it shoot at that spot ^^
that's what I'd try, haven't done so though, so take this as idea, not as solid and 100% guaranteed-to-work knowledge please thank you for the help when moving the camera in mouselook does your head move accurately with your camera position?
|
|
Tanith Rosenbaum
Registered User
Join date: 10 Sep 2008
Posts: 42
|
04-16-2009 02:27
From: Johnthe Finesmith thank you for the help when moving the camera in mouselook does your head move accurately with your camera position? Good question. I suppose, but I don't know for sure. anyone?
|
|
Johnthe Finesmith
Registered User
Join date: 2 Jun 2008
Posts: 10
|
04-16-2009 02:50
ok because if the head does move accurately I could make a helmet use its local rot and maybe figure out a way to make the gun use some sort of camera script that is based at the perfect tip of the gun to feed the gun's view to my camera that way when my helmet moves while Im in mouselook my gun shifts and rotates when my head moves and fires when I press the space bar
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
04-16-2009 15:59
The local rot of attachments does not change to reflect any anims/avatar joint movements.
As far as attachments are concerned, I think we are all sliding around in a T pose with all attachments centered on the pelvis.
However the camera's pos/rot do reflect the position of the camera in the agent's client, this is one of the rare cases where a state in the client can be read from a script on the server.
In mouselook, the client's camera rotation is also reflected in the agent's sensed rotation. I believe you can use difference between the camera's pos and the agent's pos to determine avatar's head offset in its current pose. ~Boss
|