Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 8, 2008, 5:13:18 PM (15 years ago)
Author:
landauf
Message:

added mbool (bool with memory) to fix particlespawner-on-client problem. maybe further changes are needed if a similar problem affects other classes.

if the mbool changes from true to false and back to true within one server tick, the value stays true on the client, but a callback is called.
if you have to switch the state also on the client, a more advanced control logic is needed, but also possible with mbool (you could use 2 mbools, synchronize one and compare with the other).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/util/Math.h

    r2114 r2155  
    3939#include <ostream>
    4040#include <string>
     41#include <cmath>
    4142#include <boost/static_assert.hpp>
    4243
     
    145146    {
    146147        return x*x*x;
    147     }
    148 
    149     /**
    150         @brief Rounds the value down.
    151     */
    152     template <typename T>
    153     inline int floor(T x)
    154     {
    155         return (int)(x);
    156     }
    157 
    158     /**
    159         @brief Rounds the value up.
    160     */
    161     template <typename T>
    162     inline int ceil(T x)
    163     {
    164         int temp = floor(x);
    165         return (temp != x) ? (temp + 1) : temp;
    166148    }
    167149
Note: See TracChangeset for help on using the changeset viewer.