Extending Object3D

Started by brunotrodrigues, April 04, 2012, 05:09:30 PM

Previous topic - Next topic

brunotrodrigues

How can I do this?
I'm trying to extend it like this:


import com.threed.jpct.Object3D;

public class Unit extends Object3D{

public Unit(String textureName){
...
CODE
...
}
}


And I get the error "no suitable constructor found for Object3D."
Help?

EgonOlsen

As always when extending classes in Java, you have to make sure that the constructor of the super class that you are calling exists. You are implicitly calling the default constructor, which Object3D doesn't have. Use some constructor that Object3D actually does have...like...


public Unit(String textureName){
super(...);
CODE
...
}

brunotrodrigues

 :-[ (Such a beginner mistake)

That worked like a charm. Thanks a lot!