Source Code Project Mantis - FSSCP
View Issue Details
0001978FSSCPcutscenespublic2009-08-19 13:052012-12-14 17:54
Assigned ToValathil 
PlatformOSOS Version
Product Version3.6.11 
Target VersionFixed in Version 
Summary0001978: set camera host does not use object's eye if available
DescriptionOk, so I can set camera host to any subobject of a ship, like a capital ship's turret. If I have defined an eyepoint and tied it to that subobject, shouldn't set-camera-host use the eyepoint and not just the center of the object? If I set camera host to the parent object I would think it should use that ship's main eye point as well.
Additional InformationBasically, I was trying to use SEXPs to jump to a turret view, but I can't because the camera doesn't tie to the eyepoint, so it doesn't follow the turret. I'm assuming an eyepoint attached to a subobject does follow the subobject, and not the parent object?
TagsNo tags attached.
Attached Filespatch 1978.patch (4,437) 2012-12-13 22:34

2009-11-02 17:08   
Anyone have any thoughts?
2010-07-22 01:28   
*bump* for great justice
2010-08-24 22:37   
Hmm yes, it should use the eyepoint. :nervous:

Actually, it should be fairly easy to fix this; the eyepoint code isn't that complicated. Who (if anyone) is the camera code guru these days?
2010-08-24 23:39   
Backslash was just looking at this earlier today. I believe the SEXP was added by WMC though after reading some old forum posts over the weekend.
2010-08-25 19:54   
Well don't let the idea that I was looking at it prevent anyone more experienced from taking it on. :-) I don't fully understand it yet.

Looks to me like subobject eyepoints are never paid attention to in the code at all. If so, this is a feature request not a bug fix ;-)
2010-08-25 20:38   
(Last edited: 2010-08-25 20:40)
I don't think goober was offering but it would be nice if he were :)

Also, I'm not sure the SEXP will even use the parent object's eyepoint. I don't remember if I tested for that or not.

2010-08-29 01:03   
Ah crap. :( WMC's code is so terribly complicated that it's hard to figure out anything.

I *think* the relevant code should be around line 388 of camera.cpp, in the camera::get_info method. At least, that's the only part of the camera code that actually does something with the submodel, instead of getting or setting it.

But I can't guarantee that there isn't something I'm missing. I didn't have time to look at the code for very long.
2010-10-15 12:42 should have some materials to help reproduce the issue.
2011-08-17 19:17   
Ok, I updated that pack with something that might actually be useful. There's a mission, and a corvette with a top turret that has an eyepoint. The turret will start tracking you at mission start, and you can probably maneuver your fighter in front of it and watch the turret follow you. However, the point is that the eyepoint should be following the arms, and the camera should be attached to the eyepoint when I set it to the turret's arms. At least there's enough stuff here to reproduce what I'm talking about now, in case anyone else wants to actually see it.

Use 2 to set the camera to the corvette's turret, and 3 to go back to your fighter. Only works once because I don't FRED much and I don't know how to reset it each time. 1 just unprotects the Argo, which used to be the target of the corvette, but now it won't attack it for some reason. Probably because it's a different size than the previous ship that was in that spot in the mission and might be below the turret's firing arc now.
2012-12-13 22:38   
Ok i attached a patch which fixes the eyepoints but added something cool as well.
Since the eyepoint was defined on a turret in the testcase MjnMixael and i thought that the intention was to have the camera following the turret like a gun cam. I added that for all turrets with the camera situated on the firing points but if you have a eyepoint defined on the turret it overrides it so you can do the cam in the middle of two barrels or something. Please code review and comment if its the way it should be.
2012-12-14 06:40   
All of my yes. The patch is good, and the feature added is how I personally would expect it to behave.
2012-12-14 08:42   
One thing i thought about tho is when you set a separate target for the camera i think it gets overridden by the new custom function. Is setting the host to a turret and then a specific target a use case that has to be handled or do we want gun cam all day everyday?
2012-12-14 12:39   
You definitely understood where I was going with this, although I might have made a mistake in my test model/mission that would have not required any special treatment for turrets. Attaching the eyepoint to the barrel subobject would require the intended effect as long as the eyepoint moves with that subobject. I'll try to follow up on IRC to double check how this was implemented, I might have misunderstood your note.
2012-12-14 12:49   
It might have removed the need for the child model checking but i wanted it to work with all turrets even without defined eyepoints so i implemented it that way.
2012-12-14 14:10   
Sounds splendid to me.
2012-12-14 16:47   
Fix committed to trunk@9432.
2012-12-14 17:54   

Issue History
2009-08-19 13:05chief1983New Issue
2009-11-02 17:08chief1983Note Added: 0011222
2010-07-22 01:28chief1983Note Added: 0012256
2010-08-24 22:37Goober5000Note Added: 0012327
2010-08-24 23:39chief1983Note Added: 0012328
2010-08-25 19:54BackslashNote Added: 0012329
2010-08-25 20:38chief1983Note Added: 0012330
2010-08-25 20:40chief1983Note Edited: 0012330
2010-08-29 01:03Goober5000Note Added: 0012336
2010-10-15 12:42chief1983Note Added: 0012411
2011-08-17 19:17chief1983Note Added: 0012765
2012-01-10 14:35chief1983Assigned To => chief1983
2012-01-10 14:35chief1983Statusnew => code review
2012-01-10 14:48chief1983Assigned Tochief1983 =>
2012-01-10 14:48chief1983Statuscode review => new
2012-12-13 22:34ValathilAssigned To => Valathil
2012-12-13 22:34ValathilStatusnew => assigned
2012-12-13 22:34ValathilFile Added: 1978.patch
2012-12-13 22:38ValathilNote Added: 0014442
2012-12-13 22:38ValathilStatusassigned => code review
2012-12-14 06:40The_ENote Added: 0014454
2012-12-14 08:42ValathilNote Added: 0014455
2012-12-14 12:39chief1983Note Added: 0014457
2012-12-14 12:49ValathilNote Added: 0014459
2012-12-14 14:10chief1983Note Added: 0014460
2012-12-14 16:47ValathilChangeset attached => fs2open trunk r9432
2012-12-14 16:47ValathilNote Added: 0014461
2012-12-14 16:47ValathilStatuscode review => resolved
2012-12-14 16:47ValathilResolutionopen => fixed
2012-12-14 17:54chief1983Note Added: 0014463