Binding Camera Viewpoints



  • Is there a way to bind Camera Viewpoints to a key? Such as having a driver view and a follower cam and being able to switch between them with an input? I would eventually like to be able to use a controller and have a camera switching function bound to one of the buttons.



  • @CollinDavenport said in Binding Camera Viewpoints:

    Is there a way to bind Camera Viewpoints to a key? Such as having a driver view and a follower cam and being able to switch between them with an input? I would eventually like to be able to use a controller and have a camera switching function bound to one of the buttons.

    @CollinDavenport,

    You should be able to add a hotkey by adding an entry in the Default hotKeyProfile in HotKeys.xml (located in the resources\Config directory of your ANVEL installation). Something like this should work:

    <hotKeyProfile name="worldEditor">
         <hotKey key="Ctrl+Y">
              <command name="Vehicles.CycleVehicleView">
                   <param name="Vehicle" value="CurrentVehicle"/>
              </command>
         </hotKey>
    <hotKeyProfile>
    

    Note, for the desired keystroke, you can choose any combination that's not being used by another hot key in the file.

    Hope that helps!

    Regards,
    ANVEL Support



  • That didn't quite work for me, I tried copying that code into HotKeys.xml and nothing happens in ANVEL. I'm using the HMMWV2 as my test vehicle. Do I need to add anything specific for that? I would like to toggle between Driver Cam and Follower Cam, but I would eventually like to have a few other views too.



  • @CollinDavenport said in Binding Camera Viewpoints:

    That didn't quite work for me, I tried copying that code into HotKeys.xml and nothing happens in ANVEL. I'm using the HMMWV2 as my test vehicle. Do I need to add anything specific for that? I would like to toggle between Driver Cam and Follower Cam, but I would eventually like to have a few other views too.

    @CollinDavenport,

    We made a mistake in our previous post - you'll have to add the hotkey to the <hotKeyProfile name="worldEditor"> section of HotKeys.xml. See the updated code block in our previous post.

    Regards,
    ANVEL Support



  • That works is there a way to have it function during a simulation run? As of now it only works out of simulation.



  • @CollinDavenport said in Binding Camera Viewpoints:

    That works is there a way to have it function during a simulation run? As of now it only works out of simulation.

    @CollinDavenport,

    Yes, it's possible to bind an action to a controller button. This will get you the view switching during simulation. To do so, you'll have to edit your vehicle's definition file and the corresponding control file. Check out this example:

    In your vehicle definition xml, add something like:

    <control name="CycleCamera" type="Button">
         <action type="Command">
              <command name="Vehicles.CycleVehicleView">
                   <param name="Vehicle" value="CurrentVehicle"/>
              </command>
         </action>
    </control>
    

    Then in the control XML, add something like:

    <input name="CycleCamera" type="Button" onPress="true" key="5"><joystick button="5" /></input>
    

    Note, you'll have to add this input for each device you want to use/have defined in your control XML.

    Hope that helps!

    ANVEL Support



  • I got it to work
    Thanks,

    Collin


Log in to reply
 

Looks like your connection to ANVEL Forum was lost, please wait while we try to reconnect.