WHAT IS
3D RAD?
CLICK HERE
TO FIND OUT!


Cam1StPerson


Add interactive 1st-person view functionality to your projects!

Collision detection and response, customizable sound effects, definable parameters (actor height, maximum climbable gradient, damage on falls and enemy blows, walking speed and more).


USAGE

Once you have installed the Cam1StPerson, simply add the object to your project, place it in the scenery and go. The camera geometry and the green globe are only visible in the Virtual Editor and represent the actor's starting location and collision volume respectively.

Keep in mind that this object is a camera. In general you should make sure no other camera is active in the project, to avoid rendering conflicts.

Also note that this object requires some gravity to walk. Make sure you link it to a gravity object (for example G-Force).



Relationships. This list defines how the Cam1StPerson object relates to the objects that are linked to it, in the Object List (left side of 3D Rad main screen). Two different relationship types are supported:
  • NEUTRAL. Simply perform collision detection
  • ENEMY WEAPON. Any contact with this object inflicts a blow to the 1st-person actor. Blow intensity depends on enemy object properties and Cam1StPerson shield settings


  • Shield %. When at 100% the character is invulnerable. Zero means that the full power of a blow is suffered. Negative values are permitted and allow you to enhance the effect of enemy blows. Values above 100% are also permitted (they basically reverse the effect of blows).

    Field of view, in degrees. The lower the value, the more zoomed the scene.

    Eye height & body radius. The first parameter is basically the stature of the character. The second parameter is the radius of the collision sphere for the character. Values below 0.2 are not permitted.

    Head rotation speed, Head pitching speed, Head pitching limits (degs). These parameters allow you to set look-around responsiveness and limits.

    Walk forward speed, Walk backward speed, Walk sideways speed. These parameters allow you to set movement controls responsiveness.

    Max. climbable slope (in degrees). The terrain's gradient angle above which the actor will not be able to climb.

    Fatal falling time range (in seconds). When the actor touches ground after a fall, the duration of the falling is checked against these two parameters. If below or equal to the first factor, no energy is lost. If above or equal to the second factor, 100% of the energy is lost. Intermediate times produce intermediate energy losses.

    Controls. This group of settings allows you to specify what input devices to use to control the character. Note that to change the available default devices and/or let users of your projects to use any input device, you must add the ConfingureControls object to the project.

    The remaining controls are common to all objects.
    They are explained here.



    INTERNAL PARAMETERS


    The following internal parameters can be accessed by using event objects like EventOnValue or Script:

  • Life, between 0 and 1
  • Shield, between 0 and 1



  • CUSTOMIZING SOUND EFFECTS

    Three different sound effects are supported: generic contact, received blow and death.

    By default, only the contact effect is provided and enabled. The following is the procedure to replace the existing audio with custom sounds in .wav or .ogg format.

    The first step is installing a clone of the Cam1StPerson object:
  • press [Ctrl]+[I]
  • double click the Cam1StPerson icon
  • specify a name for the new object and click SAVE


  • This creates a new folder with a name of your choice in the

    C:\Program Files\3D Rad\3DRad_res\objects\

    folder, allowing you to modify the data without affecting the original object and any project using it.

    The new folder contains the elements of a Cam1StPerson object. Your own sound files must be copied into the data folder and properly renamed, in order to enable all supported audio effects.



    The file name for the contact sound must either be contact.wav or contact.ogg. This sound is emitted whenever the actor hits an obstacle.

    The file name for the blow sound must either be blow.wav or blow.ogg. This sound is emitted when the actor is hit by an object marked as 'enemy weapon' in the 1st-person object's relationships list (properties panel).

    The file name for the death sound must either be death.wav or death.ogg. This is emitted once when actor's energy gets zero.

    Note that if both the .wav and .ogg versions of a sound are present, the .ogg version is used.

    If neither the .wav or .ogg files are present in the folder, the corresponding audio effect is not performed.