Thread: Vector
View Single Post
Old 07-10-2011, 07:38 PM   #43
BBQ
User
 
Join Date: May 2011
Posts: 85

Submissions (2)

BBQ will become famous soon enough (30)BBQ will become famous soon enough (30)

Default

May I suggest that you include normalizing? Unit vectors can be quite useful.
Collapse Zinc:
method normalize() {
    real length = this.getLength();
    this.x /= length;
    this.y /= length;
    this.z /= length;
}
BBQ is offline   Reply With Quote