Skip to content

Misleading member names of CMatrix class #283

@Aldrin-John-Olaer-Manalansan

Description

Can anybody confirm if the orientation of each axis of the CMatrix class are different for each Game? Because I noticed that the "at" and "up" members of the CMatrix class in plugin_sa were misleading:

  • up member is supposed to represent the Y-axis, it should be called as the forward member
  • at member is supposed to represent the Z-axis, it should be called as the up member

Judging by how easy it is for devs to notice this misleading information. What is the motivation for keeping it that way? By my observation at shared/game/CVector.cpp CVector::FromMultiply3x3 function:

void CVector::FromMultiply3x3(const CMatrix& matrix, const CVector& vector) {
    Set(
        matrix.right.x * vector.x + matrix.up.x * vector.y + matrix.at.x * vector.z,
        matrix.right.y * vector.x + matrix.up.y * vector.y + matrix.at.y * vector.z,
        matrix.right.z * vector.x + matrix.up.z * vector.y + matrix.at.z * vector.z
    );
}

I can clearly confirm that up is the y-axis while at is the z-axis across any supported game since CVector is shared across all of them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions