Skip to content

[API Proposal]: Billboard Lefthanded APIs for System.Numerics.Matrix4x4 #93046

@sqeezy

Description

@sqeezy

Background and motivation

Matrix4x4 recently added APIs for left handed creation of Matrix4x4. Replacing another matrix implementation led me to nice the billboard APIs did not get left handed equivalents. In order to not confuse people about which functions are actually expecting a right handed system, we should add left handed versions for the billboard APIs.

API Proposal

namespace System.Numerics;

public partial struct Matrix4x4
{
   public static Matrix4x4 CreateBillboardLeftHanded(Vector3 objectPosition, Vector3 cameraPosition, Vector3 cameraUpVector, Vector3 cameraForwardVector)
   public static Matrix4x4 CreateConstrainedBillboardLeftHanded(Vector3 objectPosition, Vector3 cameraPosition, Vector3 rotateAxis, Vector3 cameraForwardVector, Vector3 objectForwardVector)
}

API Usage

var billboardLeftHanded = Matrix4x4.CreateBillboardLeftHanded(objectPosition, cameraPosition, cameraUpVector, cameraForwardVector);
...
var billboardConstrainedLeftHanded = Matrix4x4.CreateConstrainedBillboardLeftHanded(objectPosition, cameraPosition, rotateAxis, cameraForwardVector, objectForwardVector);

Metadata

Metadata

Labels

api-approvedAPI was approved in API review, it can be implementedarea-System.Numericshelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions