|
Post by F1Andre on Mar 10, 2015 14:39:06 GMT
It will most likely be the case. I want to script almost everything unless I'm forced to use objects. It would have been nice if 3DRAD where open source, this way we could determine such things like wether the objects gets processed faster than a script.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 10, 2015 14:41:06 GMT
that's right but i think script has the advantage until now
|
|
|
Post by mikehense on Mar 30, 2015 14:08:43 GMT
like said above, scripted logic DOES have advantage... but i think there are toooooo many cameras being used...
i'd use one cam and reset the locations.. (stop it, hide it, relocate it, show it, restart it)
i know it sounds like a lot, but it aint... a quick mod to your logic might look like this
if(iKeyDown(iKeyCode("DIK_C")))
{
camCount += 1;
minMaxCamCount();
}
if(camCount == 1)
{
iObjectStop(viewCam); iObjectHide(viewCam); iObjectLocationSet(viewCam,location1); iObjectStart(viewCam); iObjectShow(viewCam); iObjectOrientationSet(viewCam,orientation1) }
if(camCount == 2)
{
iObjectStop(viewCam); iObjectHide(viewCam);
iObjectLocationSet(viewCam,location2);
iObjectStart(viewCam); iObjectShow(viewCam);
iObjectOrientationSet(viewCam,orientation2) }
also...
the above code has a built in bug...
if the user preses the C key, he/she will go through the cams very quickly... so one key press may wind you up at cam 3... you need to add an additional qualifier and track the last change so the if condition acts sorta like a switch... preventing multiple key presses invoking the keypress...
below is a small sample code representing a project where the fish skinmesh is used as cam location and orientation pointers... and at initialization, the locations and orientations are obtained and the fishes are then hidden as they are no longer needed...
int camCount=0, oldCamCount=-1;
int car= 12345;
int viewCam=OBJ_22;
Vector3 location1, location2;
Quaternion orientation1, orientation2;
void Main()
{
// get the cam locations and orientations for future use // if(iInitializing()){
iObjectLocation(OBJ_44, location1); iObjectOrientation(OBJ_44, orientation1);
iObjectLocation(OBJ_66, location2); iObjectOrientation(OBJ_66, orientation2);
}
if(iKeyDown(iKeyCode("DIK_C")) && oldCamCount!=camCount)
{
camCount += 1;
}
if(camCount == 1 && oldCamCount!=1)
{
iObjectStop(viewCam); iObjectHide(viewCam);
iObjectLocationSet(viewCam,location1);
iObjectStart(viewCam); iObjectShow(viewCam);
iObjectOrientationSet(viewCam,orientation1);
oldCamCount=camCount;
}
if(camCount == 2 && oldCamCount!=2)
{
iObjectStop(viewCam); iObjectHide(viewCam);
iObjectLocationSet(viewCam,location2);
iObjectStart(viewCam); iObjectShow(viewCam);
iObjectOrientationSet(viewCam,orientation2);
oldCamCount=camCount;
}
}
less cams, cleaner logic... should have better performance, less chance of unintended user action...
--Mike
|
|
|
Post by F1Andre on Mar 30, 2015 14:27:01 GMT
Brilliant, certianly going to do that. Instead of determining and calculating on where to put the camera, just add skinmeshes(just a 2d square) for where you want the canera and use thi locations. It is small stuff like this that can make the framerate improve.
|
|
|
Post by mikehense on Mar 30, 2015 14:48:06 GMT
hey there 'Dre... look above for some additional info... (you're too quick ) yup... it's the small things like this that can make a big difference... --Mike
|
|
|
Post by F1Andre on Mar 30, 2015 15:41:34 GMT
Thanks, I have seen with previous testing that of you stop a camchase the camera wont change. I think I mentioned it somewhere in this thread. I have no clue as to why it is doing this.
|
|