Results 1 to 2 of 2

Thread: Source Code

  1. #1

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Source Code

    The following lists the source code that is currently available.

    ---------------
    Code may be beta and thus may not work properly. As such, all code should be used at your own risk.
    ---------------
    Last edited by wossname; Sep 28th, 2005 at 06:58 AM.
    I don't live here any more.

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Name: Vector

    Vector class [v 1.0]:

    Use:
    - This is the fundamental class for all vectors and most points in our 3D world. It stores 3 floats (X, Y, Z).

    Member variables:
    • float fX: Holds the X position.
    • float fY: Holds the Y position.
    • float fZ: Holds the Z position.


    Functions:
    • Operator ==: Checks if two operators have the same X, Y and Z component.
    • Operator != (Vector, Vector): Checks if two operators have one or more components that are not the same.
    • Operator + (Vector, Vector): Adds one vector to an other vector.
    • Operator - (Vector, Vector): Subtract one vector from an other.
    • Operator - (Vector): Changes the sign of all the components in the vector.
    • Operator * (float, Vector): Multiplies each component of a vector with a float.
    • Operator * (Vector, float): Multiplies each component of a vector with a float.
    • Operator * (Vector, float): Devides each component of a vector with a float.
    • Operator / (float, Vector): Devides each component of a vector with a float.
    • Magnitude (): Returns the length of the vector.
    • Normalise (): Returns a normalized version of the vector.
    • NormalizeThis (): Normalizes this vector.
    • DotPro (Vector): Returns the dot product between this vector and an other one.
    • AngleBetween (Vector): Returns the angle between this vector and an other vector.
    • Normal (Vector): Returns the normal between this and an other vector.
    • CrossProd (Vector): Returns the cross product between this and and an other vector.
    • To2DPointFromXY (): Returns the X and Y component as a 2D point.
    • Print (): Prints out the values of X, Y, and Z for debugging purpose.


    History:
    • 19.09.05 - Added to this thread.
    • 16.10.05 - Took away W as a member, and changed the functions acordingly, since there was no use for it.



    .
    Attached Files Attached Files
    Last edited by NoteMe; Oct 16th, 2005 at 09:53 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width