Cameras

Vehicle cameras are defined in the vehicle jbeam. There are several types of camera, each defined with their own section name. They are usually found in the body or frame part of a vehicle. All cameras require valid refNodes to determine position and rotation.

cameraExternal

The cameraExternal section adds the camera known also known as “Orbit Camera” to the vehicle.

Arguments

Name Type Required/Default Range Description  
distance Float 5 >0 Starting distance from camera to focal point in m  
distanceMin Float 3 >=0 Minimum distance from camera to focal point in m (limits player from zooming in too close)  
offset vector 0 na Position offset of the focal point from the refnode in m. In the form of {“x”:0, “y”:0, “z”:0}  
fov Float Yes >0 Starting field of view in degrees  

cameraChase

The cameraChase section adds the “Chase” camera to the vehicle.

Arguments

Name Type Required/Default Range Description  
distance Float 5 >0 Starting distance from camera to focal point in m  
distanceMin Float 3 >=0 Minimum distance from camera to focal point in m (limits player from zooming in too close)  
offset vector 0 na Postion offset of the focal point from the refnode in m. In the form of {“x”:0, “y”:0, “z”:0}  
fov Float 65 >0 Starting field of view in degrees  
defaultRotation vector {“x”:0, “y”:-17, “z”:0} na Rotation offset of the camera from the refnode coordinates in degrees. In the form of {“x”:0, “y”:0, “z”:0}  

camerasInternal

The camerasInternal section can add more than one special cameras to the vehicle. These cameras create a physics node which is attached to the vehicle with beams. The cameras then move wherever the node does as the vehicle moves.

camerasInternal are used to create the driver and hood cameras in shipped vehicles.

Arguments

Name Type Required/Default Range Description  
name String Yes Name of camera. “driver” and “hood” have some hardcoded special behavior. “dash” is deprecated. Use “driver” instead.    
type String Yes Name of camera. Deprecated but works the same as “name”    
x Float Yes x position of the generated camera node in jbeam coordinates system (m)    
y Float Yes y position of the generated camera node in jbeam coordinates system (m)    
z Float Yes z position of the generated camera node in jbeam coordinates system (m)    
fov Float Yes Field of view (deg)    
id1: String nil Name of the node which a camera mounting beam should attach to    
id2: String nil Name of the node which a camera mounting beam should attach to    
id3: String nil Name of the node which a camera mounting beam should attach to    
id4: String nil Name of the node which a camera mounting beam should attach to    
id5: String nil Name of the node which a camera mounting beam should attach to    
id6: String nil Name of the node which a camera mounting beam should attach to    
id7: String nil Name of the node which a camera mounting beam should attach to    
id8: String nil Name of the node which a camera mounting beam should attach to    
nodeWeight Float 25 Mass of the camera node (Kg)    
beamSpring Float 4300000 Spring rate of the beams attaching the camera node (N/m)    
beamDamp Float 580 Damping of the beams attaching the camera node (N/m/s)    
beamDeform Float 220000 Yield strength of the beams attaching the camera node (N)    
beamStrength Float FLT_MAX Break strength of the beams attaching the camera node (N)    
collision Bool TRUE Sets whether the node collides with other vehicles or the level    
selfCollision Bool TRUE Sets whether the node collides with the vehicles own collision tris    
rightHandCamera Bool FALSE Used for right hand drive cars. Changes camera look around behavior of “dash” and “driver” camera type    
idCam: String nil Creates a camera on the chosen node instead of creating a new one    
idRef: String nil Uses the chosen node as a refnode. If nil the vehicle refnodes are chosen    
idBack: String nil Uses the chosen node as a refnode. If nil the vehicle refnodes are chosen    
idUp: String nil Uses the chosen node as a refnode. If nil the vehicle refnodes are chosen    
cockpitCamera Bool false Deprecated cockpit camera flag. Use “name”:”driver” instead.    

Special note: The number of entries in each camera definition much match the header. However, if id1-id8 are in the header, they can be skipped by entering [] instead of a string. This way you dont have to actually create any beams.