StereoKitC/systems/hand/hand_mirage.cpp
// Time conversion code from David Fields, thank you!
Time conversion code from David Fields, thank you!
Time conversion code from David Fields thank you!
static inline int64_t SourceDurationTicksToDestDurationTicks(int64_t sourceDurationInTicks, int64_t sourceTicksPerSecond, int64_t destTicksPerSecond) {
    int64_t whole = (sourceDurationInTicks / sourceTicksPerSecond) * destTicksPerSecond;                          
    int64_t part  = (sourceDurationInTicks % sourceTicksPerSecond) * destTicksPerSecond / sourceTicksPerSecond;   
    return whole + part;
}
static inline int64_t SourceDurationTicksToDestDurationTicks ( int64_t sourceDurationInTicks , int64_t sourceTicksPerSecond , int64_t destTicksPerSecond ) { int64_t whole = ( sourceDurationInTicks / sourceTicksPerSecond ) * destTicksPerSecond ; int64_t part = ( sourceDurationInTicks % sourceTicksPerSecond ) * destTicksPerSecond / sourceTicksPerSecond ; return whole + part ; }
Time conversion code from David Fields, thank you!
Time conversion code from David Fields thank you!
// 'whole' is rounded down in the target time units. // 'part' is the remainder in the target time units.