Jump to content

  • Log In with Google      Sign In   
  • Create Account

Brother Bob

Member Since 26 Nov 2001
Online Last Active Today, 10:26 AM

Posts I've Made

In Topic: C++ Question About Objects

21 September 2015 - 07:25 AM

 In C++ first the base object is created and then the derived version, calling a virtual function is in that case undefined behaviour for C++.


Calling virtual functions form the base class constructor is perfectly fine and well specified. During construction of the Asset base class, the concrete type of the object is Asset (the concrete type is not Level until later during construction) and the virtual call is dispatched to Asset::Load.


Since Asset::Load is pure there is a chance it also has no implementation. In that case I believe the behaviour of calling Load is undefined. Otherwise, there are no problems calling virtual functions other than ones understanding of the rules.

In Topic: C++ Question About Objects

21 September 2015 - 12:24 AM

If all you are actually concerned about is the syntax and the separate call to load, then just do the loading in the constructor instead of in a separate load function.

Level level("level1");

In Topic: Non-linear zoom for 2D

04 September 2015 - 05:10 PM

Do linear interpolation in logarithmic domain instead.

  1. Calculate the logarithm of your start and end values, whatever they represent. Any log-base is fine.
  2. Linearly interpolate between the two logarithms as usual.
  3. For every step in your animation/interpolation, calculate the inverse of the chosen logarithm to determine the instantaneous linear scale.

The natural log() and exp() functions work just fine for step 1 and 3, respectively.

In Topic: acos ( ) in Java has gone bezierk

30 August 2015 - 02:20 PM

It's 1.325 radians, which is the same as 75.930 degrees.

In Topic: Technical audio questions?

25 July 2015 - 04:41 PM

For technical questions, there are a few suitable places for different kinds of audio related questions. You have Maths and Physics for mathematical and theoretical questions, APIs and Tools if you have problems with specific audio APIs, and then there's always the last resort for anything related to programming: General Programming. Pick a place that seems suitable; we'll move it if it's entirely out of place.