There are 3 different sections of cameras within jbeam. The cameraExternal, refering to the orbit camera, cameraChase refering to the chase camera, and cameraInternal, which is used for the dash, hood and other custom cameras.
CameraExternal and CameraChase should both be defined within the same component as the refnodes (usually the frame or body of a vehicle depending on its construction), but in some cases they can be re-defined by other parts such as the H-Series’ cargo box upfit, to allow the player to see over it.
With all of these, when you make changes, you might need to change cameras after doing reloading the jbeam for the changes to take effect.
cameraExternal
The external camera refers to the orbit camera. It is defined using the refnode as the center point, and can be rotated freely by the player.
Required arguments
Example
"cameraExternal":{
"distance":4.5,
"distanceMin":1.5,
"offset":{"x":0.0, "y":0.2, "z":0.45},
"fov":65,
},
cameraChase
The chase camera has a mostly fixed rotation behind the car. It is defined using the refnode as the center point.
Required arguments
Example
"cameraChase":{
"distance":4.5,
"distanceMin":1.5,
"defaultRotation":{"x":0, "y":-11.2, "z":0},
"offset":{"x":0.0, "y":0.2, "z":0.7},
"fov":65,
},
camerasInternal
Internal cameras are mostly used for the hood and interior cameras, however they can also be used to set-up custom camera views, like a fender camera.
Unlike the other two cameras, which use the refnodes as their reference, internal cameras are set-up as nodes connected to the rest of the vehicle with 6 beams.
This allows us to adjust the stiffness of the camera, so the interior camera can sway under acceleration, braking and cornering forces.
Internal cameras will always keep the same angle compared to the refnode as the camera node moves, meaning that, for example, if the camera moves forward, it will point down. It is possible if required to define a secondary set of refNodes using the “idRef”, “idBack” and “idUp” properties. This is mostly used for vehicles with a rotating turret, to allow the camera to rotate with the turret.
Required arguments
The typically used types are “hood” and “dash”, however this can be set-up to any value for custom cameras.
“dash” and “driver” are used specifically to the main interior camera of the car, with special behaviors when looking back.
“dash”, “driver” and “rider” types will enable interior muffling around a certain distance from the camera.
Optional arguments
Example
"camerasInternal":[
["type", "x", "y", "z", "fov", "id1:", "id2:", "id3:", "id4:", "id5:", "id6:"],
{"nodeWeight":1.24},
{"selfCollision":false},
{"rightHandCamera":true},
{"collision":false},
{"beamSpring":46000,"beamDamp":435},
//hood cam
["hood", 0.0, -0.64, 1.20, 65, "f7r","f7l","c3r","c3l","p1r","p1l", {"beamDeform":5001000,"beamStrength":"FLT_MAX"}],
{"beamSpring":400,"beamDamp":75},
{"selfCollision":true},
{"collision":true},
//dash cam
["dash", -0.343, 0.18, 1.23, 55, "f1rr","f2l","f3rr","f4rr","f4ll",[], {"beamDeform":5001000,"beamStrength":"FLT_MAX"}],
],