Updates from September, 2017 Toggle Comment Threads | Keyboard Shortcuts

  • frankiezafe 18:50 on 2017-09-17 Permalink | Reply
    Tags: , , , ,   

    Not very sexy, but very useful: there are 2 new methods in the bullet wrapper that enables retrieval of an ordered list of the collisions along a ray.

    The job was super easy, thanks to the bullet lib consistency and documentation. The object to use is AllHitsRayResultCallback. Once processed, it returns a list of bodies touched by the given ray.

    The last part of the job was to order this list. The fastest way I thought of was to use an std::map, and use distances between the start of the ray and the hit point as keys. The nice thing with maps is that they are automatically sorted, if you use a native numeric key, such as floats.

    This map is then turned into an array of PBulletRay.

    In the code that use these methods, you can loop over the array, all objects are sorted from the closest (relatively to camera) to the farthest.

    Available in repo (not yet documented nor doxygened)

     
  • frankiezafe 22:41 on 2017-09-15 Permalink | Reply
    Tags: , ,   

    Camera rig example in engine 

    A new example showing how to use the class PCamRig object is available in the engine’s samples.

    PCamRig is using PRange objects to describe all rotations (pitch, yaw & roll), enabling a simple control of the angles.

    In the example, roll is going from 0° to 90° and yaw from -45° to 45°, the mouse is only controlling the percentage of each range applied on the camera. There is a subtlety about axis of rotation explained in the code.

    It comes with a simple way to interpolate value with an “elastic” effect. Explanation about the interpolation can be found here: Notes:Interpolation, speed/current

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel