Hi, my native is c++ but I'm playing with max, I'm having problems getting the constructors to work the way I want, is there a way of doing something similar to you would in c++:
And the constructor in c++
That's it, this is how c++ inherits from the base entity, I cant seem to do this is Bmax?
Thanks.
Type Position Field m_x:double, m_y:double; Function Create:Position(x:double, y:double) Local pos:Position = New Position; pos.m_x = x; pos.m_y = y; return pos; End Function Method getX:Double() return m_x; End Method Method getY:Double() return m_y; End Method Method setX:Double(x:Double) m_x = x; End Method Method setY:Double(y:Double) m_y = y; End Method End Type Type Entity Field m_position:Position; Function Create:Entity( position:Position ) local ent:Entity = new Entity; ent.m_position = position; return ent; End Function Method getPosition:Position() return m_position; End Method Method setPosition:Position(position:Position) m_position = position; End Method End Type Type Player Extends Entity Function Create:Player(position:Position) local ent:Player = New Player; ' Not sure what to put now for inheriting from Entity? Return ent; End Function End Type 'And this is what I want to do, which you would do in c. myPlayer:Player = Player.Create(Position(10, 10));
And the constructor in c++
Enemy(const Position& position) :Entity(position) { }
That's it, this is how c++ inherits from the base entity, I cant seem to do this is Bmax?
Thanks.