Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.
1 to 36 of 36
public class add_erv extends Script{
private SceneObject PARENT_SCO;
private SceneObjectElement[] CAM_ELEMENTS;
public bool onInit(){
SEATS = object.countSpecificElements(ELEMENTS, "CAMERA");
CAM_ELEMENTS = new SceneObjectElement[SEATS];
CAM_ELEMENTS = findAndExtractElements(ELEMENTS,"CAMERA");
RIDE_CAM = setup_POV(PARENT_SCO, "", assign_POV_Matrix(findAndExtractElements(ELEMENTS, "CAMERA")), 1.0f); //Look at picture 1 and 2
return true;
}
/*////////////////// ---------> REMOVE THIS LINE TO MAKE IT WORK FOR ANIMATED FLATRIDES AND COASTERS <------------- ///////////////////
public void onNextFrame(float t){
erv.update_POV(CAM_ELEMENTS, RIDE_CAM, 1.0f);
}
public void update_POV(SceneObjectElement[] INPUT_FLATRIDE, ExternalRideView[] INPUT_POV){
for(int i = INPUT_POV.length-1; i >= 0; i--){
INPUT_POV[i].setCameraMatrix(INPUT_FLATRIDE[i].getAbsoluteMatrix());
}
}
////////////////// ---------> REMOVE THIS LINE TO MAKE IT WORK FOR ANIMATED FLATRIDES AND COASTERS <------------- /////////////////// */
public ExternalRideView[] setup_POV(SceneObject INPUT_FLATRIDE, Matrix4x4f[] INPUT_SEATS_MATRIX, float INPUT_WARP_RANGE, float INPUT_X_ROT, float INPUT_Y_ROT, float INPUT_Z_ROT){ //TODO: Vector3f INPUT_POSITION
ExternalRideView[] TEMP_POV = new ExternalRideView[INPUT_SEATS_MATRIX.length];
Matrix4x4f XMatrix = new Matrix4x4f();
Matrix4x4f YMatrix = new Matrix4x4f();
Matrix4x4f ZMatrix = new Matrix4x4f();
XMatrix.initXRot((float)Math.toRadians(INPUT_X_ROT));
YMatrix.initYRot((float)Math.toRadians(INPUT_Y_ROT));
ZMatrix.initZRot((float)Math.toRadians(INPUT_Z_ROT));
for(int i = INPUT_SEATS_MATRIX.length-1; i >= 0; i--){
INPUT_SEATS_MATRIX[i].multRight(XMatrix);
INPUT_SEATS_MATRIX[i].multRight(YMatrix);
INPUT_SEATS_MATRIX[i].multRight(ZMatrix);
TEMP_POV[i] = NoLimits.getSimulator().createExternalRideView();
TEMP_POV[i].setEnterWarpPoint(INPUT_SEATS_MATRIX[i].getTrans(), INPUT_WARP_RANGE);
TEMP_POV[i].setEnterWarpPointEnabled(true);
//TEMP_POV[i].setLabel(getFlatrideName(INPUT_FLATRIDE)+" ( Seat "+(i-1)+" )");
TEMP_POV[i].setCameraMatrix(INPUT_SEATS_MATRIX[i]);
}
return TEMP_POV;
}
public Matrix4x4f[] assign_POV_Matrix(SceneObjectElement[] INPUT_CAMERA_ELEMENTS){
Matrix4x4f[] CAMERA_MATRIX = new Matrix4x4f[INPUT_CAMERA_ELEMENTS.length];
for(int i = INPUT_CAMERA_ELEMENTS.length-1; i >= 0; i--){
CAMERA_MATRIX[i] = INPUT_CAMERA_ELEMENTS[i].getAbsoluteMatrix();
}
return CAMERA_MATRIX;
}
public SceneObjectElement[] findAndExtractElements(SceneObjectElement[] INPUT_ELEMENT_ARRAY, String INPUT_SEAT_NAME_PREFIX){
/////////////////
// Detect amount of elements
int countUp = 0;
for(int i = INPUT_ELEMENT_ARRAY.length-1; i > 0; i--){
for(int j = INPUT_ELEMENT_ARRAY.length; j > -1; j--){
if(INPUT_ELEMENT_ARRAY[i].getName().equals(INPUT_SEAT_NAME_PREFIX+(j))){
countUp++;
}
}
}
SceneObjectElement[] extractElements = new SceneObjectElement[countUp];
for(int i = INPUT_ELEMENT_ARRAY.length-1; i > 0; i--){
for(int j = INPUT_ELEMENT_ARRAY.length; j > -1; j--){
if(INPUT_ELEMENT_ARRAY[i].getName().equals(INPUT_SEAT_NAME_PREFIX+(j))){
countUp--;
extractElements[countUp] = INPUT_ELEMENT_ARRAY[i];
}
}
}
return extractElements;
}
}
Posted By: BlaseRhineOf course! :) We love to help the community the best we can! We think this will benefit many users!
Gatekeeper style station- Fitted to almost every coaster type
1 to 36 of 36