Bruno is a cinematic camera manager that can be used for interactions or cinematic scenes

 

To create a custom camera you need to register a CustomPoint

Here is an example how to register a CameraPoint

// registration
@Mod.EventBusSubscriber(modid = YourMod.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
public class register {
    public static CameraPointAccessor POINT;
@SubscribeEvent
public static void onCameraManagerSetup(CameraManagerSetupEvent event) {
    POINT = event.manager.registerPoint("point", CameraPoint.of(
            new Vec3(
                    0,              // x
                    100,            // y
                    0               // z
            ),
            0,                      // yaw
            0,                      // pitch
            0.5f,                   // fov
            1000,                   // duration
            Easing::easeInOutQuad,  // Easing function
            false                   // renderPlayer
    ));
}

}



as soon as the CameraPoint is registered you can transition to the point on client like this

com.smibii.cameraman.listeners.Camera.manager.transitionToPoint(POINT_NAME)

and on server like this

com.smibii.cameraman.network.NetworkHandler.sendToClient(
       new CameraToPointPacket(POINT_NAME),
       player);

 

If you want to get back to the player can eather transition back to the player

// Client
com.smibii.cameraman.listeners.Camera.manager.transitionToPlayer()

// Server NetworkHandler.sendToClient( new CameraToPlayerPacket(), player);

or abruptly exit the camera with

// Client
com.smibii.cameraman.listeners.Camera.manager.setInUse(false);

// Server NetworkHandler.sendToClient( new CameraSetInUsePacket(false), player);

 

Feel free to use the api in ur mod, modpack or modify it BUT make sure to mention me. 

Thanks.

 


Project members

smibii

Creator

Details

Licensed ARR
Published 2 months ago
Updated 2 months ago