Author Topic: how do i find the player's head?  (Read 2038 times)

0 Members and 1 Guest are viewing this topic.

how do i find the player's head?
There doesn't seem to be a way to find out the player's eyepoint from Lua.  It looks like the intention was to have a model have a list of eyepoints, but it was never implemented.

It would be nice to know because my airquake mouse mod is currently a chasecam, but in physics/physics.cpp we find the comment that the player is never supposed to be able to have his eye orientation stray more than π/2 from his ship's orientation.  Also, chasecam isn't as good for precise targeting, as required for weapons that you can't constantly shoot.  But in order to move the camera back into the ship, we need to know where on the ship the camera belongs.

Any ideas?  Is it possible to manipulate the camera orientation without needing this information?

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: how do i find the player's head?
Well, ChaseCam is already implemented-- it's the decimal point on your number pad. You can also find the eyepoints for individual fighters using ModelView or PCS. But if you're looking to pull "player_eyepoint_position" or something for scripting, I can't help you.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: how do i find the player's head?
Look for the boxes that say "HEADZ".
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: how do i find the player's head?
 :headz:
.pof's without manually added eyepoints take the 0,0,0 (pivot point) as eyepoint
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Wobble73

  • 210
  • Reality is for people with no imagination
    • Steam
Re: how do i find the player's head?
Look above his shoulders, a majority of the time, that's where the head is, atop of some thing called the neck.
 :lol:
Who is General Failure and why is he reading my hard disk?
Early bird gets the worm, but the second mouse gets the cheese
Ambition is a poor excuse for not having enough sense to be lazy.
 
Member of the Scooby Doo Fanclub. And we're not talking a cartoon dog here people!!

 You would be well adviced to question the wisdom of older forumites, we all have our preferences and perversions

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: how do i find the player's head?
Somehow, I just knew this topic was going to go downhill when I read the title...
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: how do i find the player's head?
id just create a camera, probibly without attatching it to the ship. use the ships radius or bounding box to guestimate how big it is (and how far behind it to place the camera), and compute an offset above and behind the ship, far enough back to see the word more than the ship but not so far you cant see the model. now airquake kinda used an orbital type camera so you will need need to come up with an orientation matrix that represents this rotation and unrotate the offset by it (i think). you would probibly use mouse deltas to come up with a fresh matrix and multiply your current view matrix by it every frame. this should pivot the viewpoint vector around the ship. you will then most likely have to add the ships world position to that. this gets the camera world position, now you need to figure out its orientation. you will want to look in the general direction of the ship, but not directly at it. if you want things to be exactly like airquake where the cameras roll was always level to the horizon, you could simply subtract the ship position from the camera position, zero out the y component and then create an orientation from the vector and set the camera to it. this is probibly not 100% correct, id have to actually implement it to check the math.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

  

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: how do i find the player's head?
There doesn't seem to be a way to find out the player's eyepoint from Lua.  It looks like the intention was to have a model have a list of eyepoints, but it was never implemented.

Yeah, it was never implemented. As such, the whole eyepoint structure is completely useless.