This commit is contained in:
2025-07-27 12:34:04 +08:00
parent 6311c7cb12
commit 743c1d2baa
194 changed files with 81685 additions and 696 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -33,7 +33,7 @@ message Chat2G_CreateRouteResponse // IRouteResponse
// Protocol Bson // Protocol Bson
message M2M_SendUnitRequest // IRouteRequest,M2M_SendUnitResponse message M2M_SendUnitRequest // IRouteRequest,M2M_SendUnitResponse
{ {
Unit Unit = 1;
} }
// Protocol Bson // Protocol Bson
message M2M_SendUnitResponse // IRouteResponse message M2M_SendUnitResponse // IRouteResponse

View File

@@ -0,0 +1,7 @@
using Fantasy.Entitas;
namespace Fantasy;
public class ChatComponent : Entity
{
}

View File

@@ -19,6 +19,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Fantasy\Fantasy.Net\Fantasy.Net\Fantasy.Net.csproj" /> <ProjectReference Include="..\Fantasy\Fantasy.Net\Fantasy.Net\Fantasy.Net.csproj" />
<ProjectReference Include="..\Fantasy\Fantasy.Packages\Fantasy.ConfigTable\Net\Fantasy.ConfigTable.csproj" /> <ProjectReference Include="..\Fantasy\Fantasy.Packages\Fantasy.ConfigTable\Net\Fantasy.ConfigTable.csproj" />
<ProjectReference Include="..\ThirdParty\ThirdParty.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -28,6 +29,7 @@
<ItemGroup> <ItemGroup>
<Folder Include="Gate\" /> <Folder Include="Gate\" />
<Folder Include="Map\" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -0,0 +1,46 @@
using Fantasy.DataStructure.Collection;
using Fantasy.Entitas;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
using NB.Game;
namespace NB;
public sealed class Container : Entity
{
/// <summary>
/// 可用格子数量
/// </summary>
public int CellCount;
/// <summary>
/// 最大格子数量
/// </summary>
public int CellCountMax;
/// <summary>
/// 当前已经使用格子数量
/// </summary>
public int CurrentCellCount;
/// <summary>
/// 容器内的物品
/// </summary>
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
public Dictionary<long, Item> Items = new Dictionary<long, Item>();
/// <summary>
/// 容器内物品,按格子进行分组
/// </summary>
[BsonIgnore] public Dictionary<uint, Item> ItemsByCell = new Dictionary<uint, Item>();
/// <summary>
/// 按物品id分组
/// </summary>
[BsonIgnore] public readonly OneToManyList<uint, Item> ItemsByConfigId = new OneToManyListPool<uint, Item>();
/// <summary>
/// 容器内按物品类型分组
/// </summary>
[BsonIgnore] public readonly OneToManyList<uint, Item> ItemsByType = new OneToManyListPool<uint, Item>();
}

View File

@@ -0,0 +1,23 @@
using Fantasy.Entitas;
namespace NB;
public enum ContainerType : uint
{
/// <summary>
/// 背包
/// </summary>
Bag,
/// <summary>
/// 鱼护
/// </summary>
FishBag,
}
/// <summary>
/// 物品容器组件
/// </summary>
public class ContainerComponent : Entity
{
}

View File

@@ -1,16 +0,0 @@
using Fantasy.Entitas;
namespace NB.Game;
public class Currency : Entity
{
/// <summary>
/// 配置id
/// </summary>
public int ConfigId;
/// <summary>
/// 拥有的数量
/// </summary>
public int Count;
}

View File

@@ -1,5 +0,0 @@
namespace NB.Game;
public class DayFlags
{
}

View File

@@ -1,21 +0,0 @@
using Fantasy.Entitas;
namespace NB.Game;
public class GamingInfo : Entity
{
/// <summary>
/// 地图
/// </summary>
public int Map;
/// <summary>
/// 位置
/// </summary>
public int Pos;
/// <summary>
/// 进入时间
/// </summary>
public int Time;
}

View File

@@ -1,26 +0,0 @@
using Fantasy.Entitas;
namespace NB.Game;
public class Guide : Entity
{
/// <summary>
/// 排序
/// </summary>
public int Sort;
/// <summary>
/// 配置id
/// </summary>
public int ConfigId;
/// <summary>
/// 步骤
/// </summary>
public int Step;
/// <summary>
/// 触发时间
/// </summary>
public long GetTime;
}

View File

@@ -1,7 +0,0 @@
using Fantasy.Entitas;
namespace NB.Game;
public class MapMatter : Entity
{
}

View File

@@ -1,7 +0,0 @@
using Fantasy.Entitas;
namespace NB.Game;
public class Mission : Entity
{
}

View File

@@ -1,11 +0,0 @@
using Fantasy.Entitas;
namespace Fantasy;
/// <summary>
/// 玩家信息
/// </summary>
public class Player : Entity
{
}

View File

@@ -1,7 +0,0 @@
using Fantasy.Entitas;
namespace NB.Game;
public class Skill : Entity
{
}

View File

@@ -1,62 +0,0 @@
using Fantasy.Entitas;
using NB.Game;
namespace NB;
public class UserInfo : Entity
{
/// <summary>
/// 基础信息
/// </summary>
public BasicInfo BasicInfo;
/// <summary>
/// 统计信息
/// </summary>
public UserStatisticsInfo Statistics;
/// <summary>
/// 游戏信息
/// </summary>
public GamingInfo GamingInfo;
/// <summary>
/// 货币信息
/// </summary>
public List<Currency> Currency;
/// <summary>
/// 拥有的物品
/// </summary>
public List<Item> Items;
/// <summary>
/// 参与的活动
/// </summary>
public List<Activity> Activity;
/// <summary>
/// 任务列表
/// </summary>
public List<Mission> Missions;
/// <summary>
/// 账号标识
/// </summary>
public DayFlags DayFlags;
/// <summary>
/// 拥有的技能
/// </summary>
public List<Skill> Abilities;
/// <summary>
/// 引导情况
/// </summary>
public List<Guide> Guides;
/// <summary>
/// 地图情况
/// </summary>
public List<MapMatter> MapMatters;
}

View File

@@ -1,7 +1,16 @@
using Fantasy.Entitas; using Fantasy.Entitas;
using MongoDB.Bson.Serialization.Attributes;
namespace NB.Game; namespace NB.Game;
public enum ItemType
{
None = 0,
Item,
Equip,
Fish,
}
public class Item : Entity public class Item : Entity
{ {
/// <summary> /// <summary>
@@ -18,4 +27,9 @@ public class Item : Entity
/// 是否绑定 /// 是否绑定
/// </summary> /// </summary>
public bool IsBind; public bool IsBind;
/// <summary>
/// 当前所属的容器
/// </summary>
[BsonIgnore] public Container Container;
} }

View File

@@ -2,6 +2,7 @@
namespace NB.Game; namespace NB.Game;
public class Activity : Entity public class ItemComponent : Entity
{ {
} }

View File

@@ -1,8 +1,12 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace NB.Game; namespace NB;
public class BasicInfo : Entity /// <summary>
/// 角色基础数据
/// </summary>
[RoleCom]
public class RoleBasic : Entity
{ {
/// <summary> /// <summary>
/// 昵称 /// 昵称

View File

@@ -0,0 +1,15 @@
using Fantasy.Entitas;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace NB;
/// <summary>
/// 角色货币数据
/// </summary>
[RoleCom]
public class RoleCurrency : Entity
{
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
public Dictionary<int, int> dic = new();
}

View File

@@ -0,0 +1,11 @@
using Fantasy.Entitas;
namespace NB;
/// <summary>
/// 角色状态标志量
/// </summary>
[RoleCom]
public class RoleDayFlags : Entity
{
}

View File

@@ -1,8 +1,12 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace NB.Game; namespace NB;
public class UserStatisticsInfo : Entity /// <summary>
/// 角色统计数据
/// </summary>
[RoleCom]
public class RoleStatistics : Entity
{ {
/// <summary> /// <summary>
/// 登录次数 /// 登录次数
@@ -24,5 +28,8 @@ public class UserStatisticsInfo : Entity
/// </summary> /// </summary>
public long CreateTime; public long CreateTime;
/// <summary>
/// 钓鱼个数
/// </summary>
public int FishCount; public int FishCount;
} }

8
Entity/Game/Role/Role.cs Normal file
View File

@@ -0,0 +1,8 @@
using Fantasy.Entitas;
namespace NB;
public sealed class Role : Entity
{
}

View File

@@ -0,0 +1,10 @@
using CommandLine;
namespace NB;
/// <summary>
/// 挂这个 玩家Role创建时会自动添加此组件
/// </summary>
public class RoleComAttribute : BaseAttribute
{
}

View File

@@ -0,0 +1,8 @@
using Fantasy.Entitas;
namespace NB;
public class RoleManagerComponent : Entity
{
public readonly Dictionary<long, Role> Roles = new();
}

View File

@@ -3,10 +3,8 @@ using MongoDB.Bson.Serialization.Attributes;
namespace NB.Gate; namespace NB.Gate;
public sealed class GameAccount : Entity public sealed class Player : Entity
{ {
// 1、可以拿ToKen的传递过来的AId来当这个组件的Id.
// 2、让这个Id自动生成、在组件里做一个变量来记录ToKen的AId。 public long AuthenticationId;
public long CreateTime; public long CreateTime;
public long LoginTime; public long LoginTime;

View File

@@ -2,12 +2,14 @@ using Fantasy.Entitas;
namespace NB.Gate; namespace NB.Gate;
public sealed class GameAccountFlagComponent : Entity public sealed class PlayerFlagComponent : Entity
{ {
public bool Kick { get; set; }
public long AccountID; public long AccountID;
// 有一种可能当在Account在其他地方被销毁 // 有一种可能当在Account在其他地方被销毁
// 这时候因为这个Account是会回收到池子中所以这个引用还是有效的 // 这时候因为这个Account是会回收到池子中所以这个引用还是有效的
// 那这时候就会出现这个引用的Account可能是其他用户的了。 // 那这时候就会出现这个引用的Account可能是其他用户的了。
public EntityReference<GameAccount> Account; public EntityReference<Player> Account;
} }

View File

@@ -1,8 +0,0 @@
using Fantasy.Entitas;
namespace NB.Gate;
public sealed class GameAccountManageComponent : Entity
{
public readonly Dictionary<long, GameAccount> Accounts = new();
}

View File

@@ -0,0 +1,8 @@
using Fantasy.Entitas;
namespace NB.Gate;
public sealed class PlayerManageComponent : Entity
{
public readonly Dictionary<long, Player> Players = new();
}

View File

@@ -163,7 +163,6 @@ namespace Fantasy
} }
public override void Dispose() public override void Dispose()
{ {
Unit = default;
#if FANTASY_NET || FANTASY_UNITY #if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<M2M_SendUnitRequest>(this); GetScene().MessagePoolComponent.Return<M2M_SendUnitRequest>(this);
#endif #endif
@@ -171,7 +170,6 @@ namespace Fantasy
[BsonIgnore] [BsonIgnore]
public M2M_SendUnitResponse ResponseType { get; set; } public M2M_SendUnitResponse ResponseType { get; set; }
public uint OpCode() { return InnerOpcode.M2M_SendUnitRequest; } public uint OpCode() { return InnerOpcode.M2M_SendUnitRequest; }
public Unit Unit { get; set; }
} }
public partial class M2M_SendUnitResponse : AMessage, IRouteResponse public partial class M2M_SendUnitResponse : AMessage, IRouteResponse
{ {

View File

@@ -1,8 +0,0 @@
using Fantasy.Entitas;
namespace Fantasy;
public sealed class Unit : Entity
{
}

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>disable</Nullable>
<LangVersion>default</LangVersion> <LangVersion>default</LangVersion>
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
</PropertyGroup> </PropertyGroup>

View File

@@ -1,22 +0,0 @@
using System;
using Fantasy.Async;
using Fantasy.Entitas;
using Fantasy.Network;
using Fantasy.Network.Interface;
using Fantasy.Network.Route;
namespace Fantasy;
public sealed class G2M_RequestAddressableIdHandler : RouteRPC<Scene, G2M_RequestAddressableId, M2G_ResponseAddressableId>
{
protected override async FTask Run(Scene scene, G2M_RequestAddressableId request, M2G_ResponseAddressableId response, Action reply)
{
// 1、因为是测试代码所以默认每次请求这个协议我都创建一个新的Unit来做Addressable。
var unit = Entity.Create<Unit>(scene, false, true);
// 2、给Unit添加AddressableMessageComponent组件并执行Register()向AddressableScene注册自己当前的位置。
await unit.AddComponent<AddressableMessageComponent>().Register();
// 3、返回给Gate服务器AddressableId
response.AddressableId = unit.Id;
await FTask.CompletedTask;
}
}

View File

@@ -1,17 +0,0 @@
using Fantasy.Async;
using Fantasy.Entitas;
using Fantasy.Network.Interface;
namespace Fantasy;
public class G2M_CreateSubSceneRequestHandler : RouteRPC<Scene, G2M_CreateSubSceneRequest, M2G_CreateSubSceneResponse>
{
protected override async FTask Run(Scene scene, G2M_CreateSubSceneRequest request, M2G_CreateSubSceneResponse response, Action reply)
{
// 下面的SceneType传的是666其实并没有这个类型这个是我随便写的。
var subScene = Scene.CreateSubScene(scene, 6666);
// 返回subScene的运行时id
response.SubSceneRouteId = subScene.RouteId;
await FTask.CompletedTask;
}
}

View File

@@ -1,21 +0,0 @@
using Fantasy.Async;
using Fantasy.Entitas;
using Fantasy.Network.Interface;
using Fantasy.Network.Route;
namespace Fantasy;
public sealed class G2SubScene_AddressableIdRequestHandler : RouteRPC<SubScene, G2SubScene_AddressableIdRequest, SubScene2G_AddressableIdResponse>
{
protected override async FTask Run(SubScene subScene, G2SubScene_AddressableIdRequest request, SubScene2G_AddressableIdResponse response, Action reply)
{
Log.Debug($"G2SubScene_AddressableIdRequestHandler {subScene.SceneType}");
// 1、因为是测试代码所以默认每次请求这个协议我都创建一个新的Unit来做Addressable。
var unit = Entity.Create<Unit>(subScene, false, true);
// 2、给Unit添加AddressableMessageComponent组件并执行Register()向AddressableScene注册自己当前的位置。
await unit.AddComponent<AddressableMessageComponent>().Register();
// 3、返回给Gate服务器AddressableId
response.AddressableId = unit.Id;
await FTask.CompletedTask;
}
}

View File

@@ -1,13 +0,0 @@
using Fantasy.Async;
using Fantasy.Network.Interface;
namespace Fantasy;
public class G2SubScene_SentMessageHandler : Route<Scene, G2SubScene_SentMessage>
{
protected override async FTask Run(Scene scene, G2SubScene_SentMessage message)
{
Log.Debug($"接受到来自Gate的消息 SceneType:{scene.SceneType} Message:{message.Tag}");
await FTask.CompletedTask;
}
}

View File

@@ -27,7 +27,7 @@ public class OnSceneCreate_Init : AsyncEventSystem<OnCreateScene>
// 用于验证JWT是否合法的组件 // 用于验证JWT是否合法的组件
scene.AddComponent<GateJWTComponent>(); scene.AddComponent<GateJWTComponent>();
// 用于管理GameAccount的组件 // 用于管理GameAccount的组件
scene.AddComponent<GameAccountManageComponent>(); scene.AddComponent<PlayerManageComponent>();
break; break;
} }
} }

View File

@@ -21,6 +21,7 @@ public class C2A_LoginRequestHandler : MessageRPC<C2A_LoginRequest, A2C_LoginRes
session.SetTimeout(3000); session.SetTimeout(3000);
var scene = session.Scene; var scene = session.Scene;
Log.Info($"登录服场景 {scene.Id} {scene.RouteId} {scene.SceneConfigId}");
var result = await AuthenticationHelper.Login(scene, request.Username, request.Password); var result = await AuthenticationHelper.Login(scene, request.Username, request.Password);
if (result.ErrorCode != ErrorCode.Successful && result.AccountId == -1) if (result.ErrorCode != ErrorCode.Successful && result.AccountId == -1)

View File

@@ -0,0 +1,86 @@
using Fantasy.Entitas.Interface;
namespace NB.Game;
public sealed class ContainerDestroySystem : DestroySystem<Container>
{
protected override void Destroy(Container self)
{
self.CellCount = 0;
self.CellCountMax = 0;
self.CurrentCellCount = 0;
foreach (var (_, item) in self.Items)
{
item.Dispose();
}
self.Items.Clear();
self.ItemsByCell.Clear();
self.ItemsByConfigId.Clear();
self.ItemsByType.Clear();
}
}
public static class ContainerSystem
{
#region Get
/// <summary>
/// 通过唯一id获取
/// </summary>
/// <param name="self"></param>
/// <param name="id"></param>
/// <param name="item"></param>
/// <returns></returns>
public static bool GetItemById(this Container self, uint id, out Item item)
{
return self.Items.TryGetValue(id, out item);
}
/// <summary>
/// 通过格子位置获取物品
/// </summary>
/// <param name="self"></param>
/// <param name="cell"></param>
/// <param name="item"></param>
/// <returns></returns>
public static bool GetItemByCell(this Container self, uint cell, out Item item)
{
return self.ItemsByCell.TryGetValue(cell, out item);
}
/// <summary>
/// 通过配置id获取物品
/// </summary>
/// <param name="self"></param>
/// <param name="configId"></param>
/// <param name="items"></param>
public static void GetItemByConfigId(this Container self, uint configId, List<Item> items)
{
if (!self.ItemsByConfigId.TryGetValue(configId, out var itemList))
{
return;
}
items.AddRange(itemList);
}
/// <summary>
/// 通过类型获取物品
/// </summary>
/// <param name="self"></param>
/// <param name="type"></param>
/// <param name="items"></param>
public static void GetItemByType(this Container self, ItemType type, List<Item> items)
{
if (!self.ItemsByType.TryGetValue((uint)type, out var itemList))
{
return;
}
items.AddRange(itemList);
}
#endregion
}

View File

@@ -9,7 +9,7 @@ public sealed class C2G_GetAccountInfoRequestHandler : MessageRPC<C2G_GetAccount
{ {
protected override async FTask Run(Session session, C2G_GetAccountInfoRequest request, G2C_GetAccountInfoResponse response, Action reply) protected override async FTask Run(Session session, C2G_GetAccountInfoRequest request, G2C_GetAccountInfoResponse response, Action reply)
{ {
var gameAccountFlagComponent = session.GetComponent<GameAccountFlagComponent>(); var gameAccountFlagComponent = session.GetComponent<PlayerFlagComponent>();
if (gameAccountFlagComponent == null) if (gameAccountFlagComponent == null)
{ {
@@ -19,7 +19,7 @@ public sealed class C2G_GetAccountInfoRequestHandler : MessageRPC<C2G_GetAccount
return; return;
} }
GameAccount account = gameAccountFlagComponent.Account; Player account = gameAccountFlagComponent.Account;
if (account == null) if (account == null)
{ {

View File

@@ -4,8 +4,6 @@ using Fantasy.Async;
using Fantasy.Network; using Fantasy.Network;
using Fantasy.Network.Interface; using Fantasy.Network.Interface;
#pragma warning disable CS8604 // Possible null reference argument.
namespace NB.Gate.Handler; namespace NB.Gate.Handler;
public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_LoginResponse> public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_LoginResponse>
@@ -22,7 +20,7 @@ public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_L
} }
var scene = session.Scene; var scene = session.Scene;
// Log.Info($"网关服场景 {scene.Id} {scene.RouteId} {scene.SceneConfigId} {scene.RouteId} {session.RouteId}");
if (!GateJWTHelper.ValidateToken(scene, request.ToKen, out var accountId)) if (!GateJWTHelper.ValidateToken(scene, request.ToKen, out var accountId))
{ {
// 如果失败,表示肯定是恶意攻击、所以毫不犹疑,直接断开当前会话。 // 如果失败,表示肯定是恶意攻击、所以毫不犹疑,直接断开当前会话。
@@ -31,19 +29,19 @@ public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_L
} }
// 在缓存中检查该账号是否存在 // 在缓存中检查该账号是否存在
var gameAccountManageComponent = scene.GetComponent<GameAccountManageComponent>(); var gameAccountManageComponent = scene.GetComponent<PlayerManageComponent>();
Log.Debug("检查账号是否在缓存中"); Log.Debug("检查账号是否在缓存中");
if (!gameAccountManageComponent.TryGet(accountId, out var account)) if (!gameAccountManageComponent.TryGet(accountId, out var account))
{ {
// 首先要先到数据库中查询是否有这个账号 // 首先要先到数据库中查询是否有这个账号
account = await GameAccountHelper.LoadDataBase(scene, accountId); account = await PlayerHelper.LoadDataBase(scene, accountId);
// 如果有的话,就直接加入在缓存中就可以了 // 如果有的话,就直接加入在缓存中就可以了
if (account == null) if (account == null)
{ {
Log.Debug("检查到账号没有在数据库中,需要创建一个新的账号并且保存到数据库中"); Log.Debug("检查到账号没有在数据库中,需要创建一个新的账号并且保存到数据库中");
// 如果没有,就要创建一个新的并且保存到数据库。 // 如果没有,就要创建一个新的并且保存到数据库。
// 如果不存在,表示这是一个新的账号,需要创建一下这个账号。 // 如果不存在,表示这是一个新的账号,需要创建一下这个账号。
account = await GameAccountFactory.Create(scene, accountId); account = await PlayerFactory.Create(scene, accountId);
} }
else else
{ {
@@ -79,7 +77,7 @@ public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_L
// 1、客户端断线重连要给这个Session发送一个消息通知它有人登录了。 // 1、客户端断线重连要给这个Session发送一个消息通知它有人登录了。
// 2、其他的客户端登录了这个账号要给这个Session发送一个消息通知它有人登录了。 // 2、其他的客户端登录了这个账号要给这个Session发送一个消息通知它有人登录了。
var gameAccountFlagComponent = oldSession.GetComponent<GameAccountFlagComponent>(); var gameAccountFlagComponent = oldSession.GetComponent<PlayerFlagComponent>();
gameAccountFlagComponent.AccountID = 0; gameAccountFlagComponent.AccountID = 0;
gameAccountFlagComponent.Account = null; gameAccountFlagComponent.Account = null;
// 给客户端发送一个重复登录的消息,如果当前客户端是自己上次登录的,发送也不会收到。 // 给客户端发送一个重复登录的消息,如果当前客户端是自己上次登录的,发送也不会收到。
@@ -90,7 +88,7 @@ public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_L
} }
// 给当前Session添加一个组件当Session销毁的时候会销毁这个组件。 // 给当前Session添加一个组件当Session销毁的时候会销毁这个组件。
var accountFlagComponent = session.AddComponent<GameAccountFlagComponent>(); var accountFlagComponent = session.AddComponent<PlayerFlagComponent>();
accountFlagComponent.AccountID = accountId; accountFlagComponent.AccountID = accountId;
accountFlagComponent.Account = account; accountFlagComponent.Account = account;

View File

@@ -1,49 +0,0 @@
using Fantasy.Entitas.Interface;
namespace NB.Gate.System;
public sealed class GameAccountManageComponentDestroySystem : DestroySystem<GameAccountManageComponent>
{
protected override void Destroy(GameAccountManageComponent self)
{
foreach (var (_, gameAccount) in self.Accounts)
{
gameAccount.Dispose();
}
self.Accounts.Clear();
}
}
public static class GameAccountManageComponentSystem
{
public static void Add(this GameAccountManageComponent self, GameAccount account)
{
self.Accounts.Add(account.Id, account);
}
public static GameAccount? Get(this GameAccountManageComponent self, long accountId)
{
return self.Accounts.GetValueOrDefault(accountId);
}
public static bool TryGet(this GameAccountManageComponent self, long accountId, out GameAccount? account)
{
return self.Accounts.TryGetValue(accountId, out account);
}
public static void Remove(this GameAccountManageComponent self, long accountId, bool isDispose = true)
{
if (!self.Accounts.Remove(accountId, out var account))
{
return;
}
if (!isDispose)
{
return;
}
account.Dispose();
}
}

View File

@@ -2,9 +2,9 @@ using Fantasy.Entitas.Interface;
namespace NB.Gate; namespace NB.Gate;
public sealed class GameAccountDestroySystem : DestroySystem<GameAccount> public sealed class PlayerDestroySystem : DestroySystem<Player>
{ {
protected override void Destroy(GameAccount self) protected override void Destroy(Player self)
{ {
self.CreateTime = 0; self.CreateTime = 0;
self.LoginTime = 0; self.LoginTime = 0;

View File

@@ -5,18 +5,18 @@ using Fantasy.Helper;
namespace NB.Gate; namespace NB.Gate;
public static class GameAccountFactory public static class PlayerFactory
{ {
/// <summary> /// <summary>
/// 创建一个新的GameAccount /// 创建一个新的Player
/// </summary> /// </summary>
/// <param name="scene"></param> /// <param name="scene"></param>
/// <param name="aId">ToKen令牌传递过来的aId</param> /// <param name="aId">ToKen令牌传递过来的aId</param>
/// <param name="isSaveDataBase">是否在创建的过程中保存到数据库</param> /// <param name="isSaveDataBase">是否在创建的过程中保存到数据库</param>
/// <returns></returns> /// <returns></returns>
public static async FTask<GameAccount> Create(Scene scene, long aId, bool isSaveDataBase = true) public static async FTask<Player> Create(Scene scene, long aId, bool isSaveDataBase = true)
{ {
var gameAccount = Entity.Create<GameAccount>(scene, aId, false, false); var gameAccount = Entity.Create<Player>(scene, aId, false, false);
gameAccount.LoginTime = gameAccount.CreateTime = TimeHelper.Now; gameAccount.LoginTime = gameAccount.CreateTime = TimeHelper.Now;
if (isSaveDataBase) if (isSaveDataBase)

View File

@@ -2,15 +2,15 @@ using Fantasy.Entitas.Interface;
namespace NB.Gate; namespace NB.Gate;
public sealed class GameAccountFlagComponentDestroySystem : DestroySystem<GameAccountFlagComponent> public sealed class PlayerFlagComponentDestroySystem : DestroySystem<PlayerFlagComponent>
{ {
protected override void Destroy(GameAccountFlagComponent self) protected override void Destroy(PlayerFlagComponent self)
{ {
if (self.AccountID != 0) if (self.AccountID != 0)
{ {
// 执行下线过程、并且要求在5分钟后完成缓存清理。也就是5分钟后会保存数据到数据库。 // 执行下线过程、并且要求在5分钟后完成缓存清理。也就是5分钟后会保存数据到数据库。
// 由于5分钟太长了、咱们测试的时候不方便测试也可以把这个时间改短一些比如10秒。 // 由于5分钟太长了、咱们测试的时候不方便测试也可以把这个时间改短一些比如10秒。
GameAccountHelper.Disconnect(self.Scene, self.AccountID, 1000 * 60 * 5).Coroutine(); PlayerHelper.Disconnect(self.Scene, self.AccountID, 1000 * 60 * 5).Coroutine();
self.AccountID = 0; self.AccountID = 0;
} }

View File

@@ -5,7 +5,7 @@ using Fantasy.Network;
namespace NB.Gate; namespace NB.Gate;
public static class GameAccountHelper public static class PlayerHelper
{ {
/// <summary> /// <summary>
/// 从数据库中读取GameAccount /// 从数据库中读取GameAccount
@@ -13,9 +13,9 @@ public static class GameAccountHelper
/// <param name="scene"></param> /// <param name="scene"></param>
/// <param name="accountId">账号Id</param> /// <param name="accountId">账号Id</param>
/// <returns></returns> /// <returns></returns>
public static async FTask<GameAccount?> LoadDataBase(Scene scene, long accountId) public static async FTask<Player?> LoadDataBase(Scene scene, long accountId)
{ {
var account = await scene.World.DataBase.First<GameAccount>(d => d.Id == accountId); var account = await scene.World.DataBase.First<Player>(d => d.Id == accountId);
if (account == null) if (account == null)
{ {
return null; return null;
@@ -29,7 +29,7 @@ public static class GameAccountHelper
/// 保存账号到数据库中 /// 保存账号到数据库中
/// </summary> /// </summary>
/// <param name="self"></param> /// <param name="self"></param>
public static async FTask SaveDataBase(this GameAccount self) public static async FTask SaveDataBase(this Player self)
{ {
await self.Scene.World.DataBase.Save(self); await self.Scene.World.DataBase.Save(self);
} }
@@ -38,12 +38,12 @@ public static class GameAccountHelper
/// 执行该账号的断开逻辑,不要非必要不要使用这个接口,这个接口是内部使用。 /// 执行该账号的断开逻辑,不要非必要不要使用这个接口,这个接口是内部使用。
/// </summary> /// </summary>
/// <param name="self"></param> /// <param name="self"></param>
public static async FTask Disconnect(this GameAccount self) public static async FTask Disconnect(this Player self)
{ {
// 保存该账号信息到数据库中。 // 保存该账号信息到数据库中。
await SaveDataBase(self); await SaveDataBase(self);
// 在缓存中移除自己并且执行自己的Dispose方法。 // 在缓存中移除自己并且执行自己的Dispose方法。
self.Scene.GetComponent<GameAccountManageComponent>().Remove(self.Id); self.Scene.GetComponent<PlayerManageComponent>().Remove(self.Id);
} }
/// <summary> /// <summary>
@@ -62,7 +62,7 @@ public static class GameAccountHelper
// 这样的话是不是可以在登录的时候给这个组件把AccountId存到这个组件呢 // 这样的话是不是可以在登录的时候给这个组件把AccountId存到这个组件呢
// 要检查当前缓存中是否存在该账号的数据 // 要检查当前缓存中是否存在该账号的数据
var gameAccountManageComponent = scene.GetComponent<GameAccountManageComponent>(); var gameAccountManageComponent = scene.GetComponent<PlayerManageComponent>();
if (!gameAccountManageComponent.TryGet(accountId, out var account)) if (!gameAccountManageComponent.TryGet(accountId, out var account))
{ {
// 如果缓存中没有、那表示已经下线或者根本不存在该账号,应该在打印一个警告,因为正常的情况下是不会出现的。 // 如果缓存中没有、那表示已经下线或者根本不存在该账号,应该在打印一个警告,因为正常的情况下是不会出现的。
@@ -98,7 +98,7 @@ public static class GameAccountHelper
/// </summary> /// </summary>
/// <param name="self"></param> /// <param name="self"></param>
/// <returns></returns> /// <returns></returns>
public static GameAccountInfo GetGameAccountInfo(this GameAccount self) public static GameAccountInfo GetGameAccountInfo(this Player self)
{ {
// 其实可以不用每次都NEW一个新的GameAccountInfo // 其实可以不用每次都NEW一个新的GameAccountInfo
// 可以在当前账号下创建一个GameAccountInfo每次变动会提前通知这个GameAccountInfo // 可以在当前账号下创建一个GameAccountInfo每次变动会提前通知这个GameAccountInfo

View File

@@ -0,0 +1,49 @@
using Fantasy.Entitas.Interface;
namespace NB.Gate.System;
public sealed class PlayerManageComponentDestroySystem : DestroySystem<PlayerManageComponent>
{
protected override void Destroy(PlayerManageComponent self)
{
foreach (var (_, gameAccount) in self.Players)
{
gameAccount.Dispose();
}
self.Players.Clear();
}
}
public static class PlayerManageComponentSystem
{
public static void Add(this PlayerManageComponent self, Player account)
{
self.Players.Add(account.Id, account);
}
public static Player Get(this PlayerManageComponent self, long accountId)
{
return self.Players.GetValueOrDefault(accountId);
}
public static bool TryGet(this PlayerManageComponent self, long accountId, out Player? account)
{
return self.Players.TryGetValue(accountId, out account);
}
public static void Remove(this PlayerManageComponent self, long accountId, bool isDispose = true)
{
if (!self.Players.Remove(accountId, out var account))
{
return;
}
if (!isDispose)
{
return;
}
account.Dispose();
}
}

View File

@@ -12,6 +12,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fantasy.ConfigTable", "Fant
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fantasy", "Fantasy", "{B1F4CF72-A767-4509-B050-8DB30D0DC40A}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fantasy", "Fantasy", "{B1F4CF72-A767-4509-B050-8DB30D0DC40A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThirdParty", "ThirdParty\ThirdParty.csproj", "{9C25A89F-0C87-4F91-AEEA-2ECCD2763DC3}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -38,6 +40,10 @@ Global
{0A539FA2-C595-4AA3-A2C3-86BF86EA7FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A539FA2-C595-4AA3-A2C3-86BF86EA7FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A539FA2-C595-4AA3-A2C3-86BF86EA7FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A539FA2-C595-4AA3-A2C3-86BF86EA7FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A539FA2-C595-4AA3-A2C3-86BF86EA7FFB}.Release|Any CPU.Build.0 = Release|Any CPU {0A539FA2-C595-4AA3-A2C3-86BF86EA7FFB}.Release|Any CPU.Build.0 = Release|Any CPU
{9C25A89F-0C87-4F91-AEEA-2ECCD2763DC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C25A89F-0C87-4F91-AEEA-2ECCD2763DC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C25A89F-0C87-4F91-AEEA-2ECCD2763DC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C25A89F-0C87-4F91-AEEA-2ECCD2763DC3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{0A539FA2-C595-4AA3-A2C3-86BF86EA7FFB} = {B1F4CF72-A767-4509-B050-8DB30D0DC40A} {0A539FA2-C595-4AA3-A2C3-86BF86EA7FFB} = {B1F4CF72-A767-4509-B050-8DB30D0DC40A}

2
Server.sln.DotSettings Normal file
View File

@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeEditing/SuppressNullableWarningFix/Enabled/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>

14
ThirdParty/ThirdParty.csproj vendored Normal file
View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Folder Include="Unity.Mathematics\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,13 @@
using System;
namespace Unity.IL2CPP.CompilerServices
{
/// <summary>
/// This is used to indicate to IL2CPP that the static constructors should be executed eagerly at startup
/// rather than lazily at runtime.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
internal class Il2CppEagerStaticClassConstructionAttribute : Attribute
{
}
}

View File

@@ -0,0 +1,322 @@
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
using static Unity.Mathematics.math;
namespace Unity.Mathematics
{
/// <summary>
/// An affine transformation type.
/// </summary>
[Il2CppEagerStaticClassConstruction]
[Serializable]
public struct AffineTransform : IEquatable<AffineTransform>, IFormattable
{
/// <summary>
/// The rotation and scale part of the affine transformation.
/// </summary>
public float3x3 rs;
/// <summary>
/// The translation part of the affine transformation.
/// </summary>
public float3 t;
/// <summary>An AffineTransform representing the identity transform.</summary>
public static readonly AffineTransform identity = new AffineTransform(float3.zero, float3x3.identity);
/// <summary>
/// An AffineTransform zero value.
/// </summary>
public static readonly AffineTransform zero;
/// <summary>Constructs an AffineTransform from a translation represented by a float3 vector and rotation represented by a unit quaternion.</summary>
/// <param name="translation">The translation vector.</param>
/// <param name="rotation">The rotation quaternion.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public AffineTransform(float3 translation, quaternion rotation)
{
rs = float3x3(rotation);
t = translation;
}
/// <summary>Constructs an AffineTransform from a translation represented by a float3 vector, rotation represented by a unit quaternion and scale represented by a float3 vector.</summary>
/// <param name="translation">The translation vector.</param>
/// <param name="rotation">The rotation quaternion.</param>
/// <param name="scale">The scale vector.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public AffineTransform(float3 translation, quaternion rotation, float3 scale)
{
rs = mulScale(math.float3x3(rotation), scale);
t = translation;
}
/// <summary>Constructs an AffineTransform from a translation represented by float3 vector and a float3x3 matrix representing both rotation and scale.</summary>
/// <param name="translation">The translation vector.</param>
/// <param name="rotationScale">The rotation and scale matrix.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public AffineTransform(float3 translation, float3x3 rotationScale)
{
rs = rotationScale;
t = translation;
}
/// <summary>Constructs an AffineTransform from float3x3 matrix representating both rotation and scale.</summary>
/// <param name="rotationScale">The rotation and scale matrix.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public AffineTransform(float3x3 rotationScale)
{
rs = rotationScale;
t = float3.zero;
}
/// <summary>Constructs an AffineTransform from a RigidTransform.</summary>
/// <param name="rigid">The RigidTransform.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public AffineTransform(RigidTransform rigid)
{
rs = math.float3x3(rigid.rot);
t = rigid.pos;
}
/// <summary>Constructs an AffineTransform from a float3x4 matrix.</summary>
/// <param name="m">The float3x4 matrix.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public AffineTransform(float3x4 m)
{
rs = math.float3x3(m.c0, m.c1, m.c2);
t = m.c3;
}
/// <summary>Constructs an AffineTransform from a float4x4 matrix.</summary>
/// <param name="m">The float4x4 matrix.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public AffineTransform(float4x4 m)
{
rs = math.float3x3(m.c0.xyz, m.c1.xyz, m.c2.xyz);
t = m.c3.xyz;
}
/// <summary>Implicit float3x4 cast operator.</summary>
/// <param name="m">The AffineTransform.</param>
/// <returns>The converted AffineTransform.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x4(AffineTransform m) { return float3x4(m.rs.c0, m.rs.c1, m.rs.c2, m.t); }
/// <summary>Implicit float4x4 cast operator.</summary>
/// <param name="m">The AffineTransform.</param>
/// <returns>The converted AffineTransform.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x4(AffineTransform m) { return float4x4(float4(m.rs.c0, 0f), float4(m.rs.c1, 0f), float4(m.rs.c2, 0f), float4(m.t, 1f)); }
/// <summary>Returns true if the AffineTransform is equal to a given AffineTransform, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(AffineTransform rhs) { return rs.Equals(rhs.rs) && t.Equals(rhs.t); }
/// <summary>Returns true if the AffineTransform is equal to a given AffineTransform, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is AffineTransform converted && Equals(converted); }
/// <summary>Returns a hash code for the AffineTransform.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)hash(this); }
/// <summary>Returns a string representation of the AffineTransform.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("AffineTransform(({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f), ({9}f, {10}f, {11}f))",
rs.c0.x, rs.c1.x, rs.c2.x, rs.c0.y, rs.c1.y, rs.c2.y, rs.c0.z, rs.c1.z, rs.c2.z, t.x, t.y, t.z
);
}
/// <summary>Returns a string representation of the AffineTransform using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("AffineTransform(({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f), ({9}f, {10}f, {11}f))",
rs.c0.x.ToString(format, formatProvider), rs.c1.x.ToString(format, formatProvider), rs.c2.x.ToString(format, formatProvider),
rs.c0.y.ToString(format, formatProvider), rs.c1.y.ToString(format, formatProvider), rs.c2.y.ToString(format, formatProvider),
rs.c0.z.ToString(format, formatProvider), rs.c1.z.ToString(format, formatProvider), rs.c2.z.ToString(format, formatProvider),
t.x.ToString(format, formatProvider), t.y.ToString(format, formatProvider), t.z.ToString(format, formatProvider)
);
}
}
public static partial class math
{
/// <summary>Returns an AffineTransform constructed from a translation represented by a float3 vector and rotation represented by a unit quaternion.</summary>
/// <param name="translation">The AffineTransform translation.</param>
/// <param name="rotation">The AffineTransform rotation.</param>
/// <returns>The AffineTransform given the translation vector and rotation quaternion.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform AffineTransform(float3 translation, quaternion rotation) { return new AffineTransform(translation, rotation); }
/// <summary>Returns an AffineTransform constructed from a translation represented by a float3 vector, rotation represented by a unit quaternion and scale represented by a float3 vector.</summary>
/// <param name="translation">The translation vector.</param>
/// <param name="rotation">The rotation quaternion.</param>
/// <param name="scale">The scale vector.</param>
/// <returns>The AffineTransform given the translation vector, rotation quaternion and scale vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform AffineTransform(float3 translation, quaternion rotation, float3 scale) { return new AffineTransform(translation, rotation, scale); }
/// <summary>Returns an AffineTransform constructed from a translation represented by float3 vector and a float3x3 matrix representing both rotation and scale.</summary>
/// <param name="translation">The translation vector.</param>
/// <param name="rotationScale">The rotation and scale matrix.</param>
/// <returns>The AffineTransform given the translation vector and float3x3 matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform AffineTransform(float3 translation, float3x3 rotationScale) { return new AffineTransform(translation, rotationScale); }
/// <summary>Returns an AffineTransform constructed from a float3x3 matrix representing both rotation and scale.</summary>
/// <param name="rotationScale">The rotation and scale matrix.</param>
/// <returns>The AffineTransform given a float3x3 matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform AffineTransform(float3x3 rotationScale) { return new AffineTransform(rotationScale); }
/// <summary>Returns an AffineTransform constructed from a float4x4 matrix.</summary>
/// <param name="m">The float4x4 matrix.</param>
/// <returns>The AffineTransform given a float4x4 matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform AffineTransform(float4x4 m) { return new AffineTransform(m); }
/// <summary>Returns an AffineTransform constructed from a float3x4 matrix.</summary>
/// <param name="m">The float3x4 matrix.</param>
/// <returns>The AffineTransform given a float3x4 matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform AffineTransform(float3x4 m) { return new AffineTransform(m); }
/// <summary>Returns an AffineTransform constructed from a RigidTransform.</summary>
/// <param name="rigid">The RigidTransform.</param>
/// <returns>The AffineTransform given a RigidTransform.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform AffineTransform(RigidTransform rigid) { return new AffineTransform (rigid); }
/// <summary>Returns a float4x4 matrix constructed from an AffineTransform.</summary>
/// <param name="transform">The AffineTransform.</param>
/// <returns>The float4x4 matrix given an AffineTransform.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(AffineTransform transform) { return float4x4(float4(transform.rs.c0, 0f), float4(transform.rs.c1, 0f), float4(transform.rs.c2, 0f), float4(transform.t, 1f)); }
/// <summary>Returns a float3x4 matrix constructed from an AffineTransform.</summary>
/// <param name="transform">The AffineTransform.</param>
/// <returns>The float3x4 matrix given an AffineTransform.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(AffineTransform transform) { return float3x4(transform.rs.c0, transform.rs.c1, transform.rs.c2, transform.t); }
/// <summary>Returns the result of transforming the AffineTransform b by the AffineTransform a.</summary>
/// <param name="a">The AffineTransform on the left.</param>
/// <param name="b">The AffineTransform on the right.</param>
/// <returns>The AffineTransform of a transforming b.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform mul(AffineTransform a, AffineTransform b)
{
return new AffineTransform(transform(a, b.t), mul(a.rs, b.rs));
}
/// <summary>Returns the result of transforming the AffineTransform b by a float3x3 matrix a.</summary>
/// <param name="a">The float3x3 matrix on the left.</param>
/// <param name="b">The AffineTransform on the right.</param>
/// <returns>The AffineTransform of a transforming b.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform mul(float3x3 a, AffineTransform b)
{
return new AffineTransform(mul(a, b.t), mul(a, b.rs));
}
/// <summary>Returns the result of transforming the float3x3 b by an AffineTransform a.</summary>
/// <param name="a">The AffineTransform on the left.</param>
/// <param name="b">The float3x3 matrix on the right.</param>
/// <returns>The AffineTransform of a transforming b.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform mul(AffineTransform a, float3x3 b)
{
return new AffineTransform(a.t, mul(b, a.rs));
}
/// <summary>Returns the result of transforming a float4 homogeneous coordinate by an AffineTransform.</summary>
/// <param name="a">The AffineTransform.</param>
/// <param name="pos">The position to be transformed.</param>
/// <returns>The transformed position.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4 mul(AffineTransform a, float4 pos)
{
return float4(mul(a.rs, pos.xyz) + a.t * pos.w, pos.w);
}
/// <summary>Returns the result of rotating a float3 vector by an AffineTransform.</summary>
/// <param name="a">The AffineTransform.</param>
/// <param name="dir">The direction vector to rotate.</param>
/// <returns>The rotated direction vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3 rotate(AffineTransform a, float3 dir)
{
return mul(a.rs, dir);
}
/// <summary>Returns the result of transforming a float3 point by an AffineTransform.</summary>
/// <param name="a">The AffineTransform.</param>
/// <param name="pos">The position to transform.</param>
/// <returns>The transformed position.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3 transform(AffineTransform a, float3 pos)
{
return a.t + mul(a.rs, pos);
}
/// <summary>Returns the inverse of an AffineTransform.</summary>
/// <param name="a">The AffineTransform to invert.</param>
/// <returns>The inverse AffineTransform.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static AffineTransform inverse(AffineTransform a)
{
AffineTransform inv;
inv.rs = pseudoinverse(a.rs);
inv.t = mul(inv.rs, -a.t);
return inv;
}
/// <summary>Decomposes the AffineTransform in translation, rotation and scale.</summary>
/// <param name="a">The AffineTransform</param>
/// <param name="translation">The decomposed translation vector of the AffineTransform.</param>
/// <param name="rotation">The decomposed rotation quaternion of the AffineTransform.</param>
/// <param name="scale">The decomposed scale of the AffineTransform.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void decompose(AffineTransform a, out float3 translation, out quaternion rotation, out float3 scale)
{
translation = a.t;
rotation = math.rotation(a.rs);
var sm = mul(float3x3(conjugate(rotation)), a.rs);
scale = float3(sm.c0.x, sm.c1.y, sm.c2.z);
}
/// <summary>Returns a uint hash code of an AffineTransform.</summary>
/// <param name="a">The AffineTransform to hash.</param>
/// <returns>The hash code of the input AffineTransform.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(AffineTransform a)
{
return hash(a.rs) + 0xC5C5394Bu * hash(a.t);
}
/// <summary>
/// Returns a uint4 vector hash code of an AffineTransform.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="a">The AffineTransform to hash.</param>
/// <returns>The uint4 wide hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(AffineTransform a)
{
return hashwide(a.rs).xyzz + 0xC5C5394Bu * hashwide(a.t).xyzz;
}
}
}

View File

@@ -0,0 +1,626 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Diagnostics;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2 component vector of bools.</summary>
[DebuggerTypeProxy(typeof(bool2.DebuggerProxy))]
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool2 : System.IEquatable<bool2>
{
/// <summary>x component of the vector.</summary>
[MarshalAs(UnmanagedType.U1)]
public bool x;
/// <summary>y component of the vector.</summary>
[MarshalAs(UnmanagedType.U1)]
public bool y;
/// <summary>Constructs a bool2 vector from two bool values.</summary>
/// <param name="x">The constructed vector's x component will be set to this value.</param>
/// <param name="y">The constructed vector's y component will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2(bool x, bool y)
{
this.x = x;
this.y = y;
}
/// <summary>Constructs a bool2 vector from a bool2 vector.</summary>
/// <param name="xy">The constructed vector's xy components will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2(bool2 xy)
{
this.x = xy.x;
this.y = xy.y;
}
/// <summary>Constructs a bool2 vector from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2(bool v)
{
this.x = v;
this.y = v;
}
/// <summary>Implicitly converts a single bool value to a bool2 vector by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool2(bool v) { return new bool2(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool2 vectors.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); }
/// <summary>Returns the result of a componentwise equality operation on a bool2 vector and a bool value.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (bool2 lhs, bool rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool2 vector.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (bool lhs, bool2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); }
/// <summary>Returns the result of a componentwise not equal operation on two bool2 vectors.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); }
/// <summary>Returns the result of a componentwise not equal operation on a bool2 vector and a bool value.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (bool2 lhs, bool rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool2 vector.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (bool lhs, bool2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); }
/// <summary>Returns the result of a componentwise not operation on a bool2 vector.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool2 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator ! (bool2 val) { return new bool2 (!val.x, !val.y); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool2 vectors.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise bitwise and.</param>
/// <returns>bool2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator & (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x & rhs.x, lhs.y & rhs.y); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool2 vector and a bool value.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator & (bool2 lhs, bool rhs) { return new bool2 (lhs.x & rhs, lhs.y & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool2 vector.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise bitwise and.</param>
/// <returns>bool2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator & (bool lhs, bool2 rhs) { return new bool2 (lhs & rhs.x, lhs & rhs.y); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool2 vectors.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise bitwise or.</param>
/// <returns>bool2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator | (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x | rhs.x, lhs.y | rhs.y); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool2 vector and a bool value.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator | (bool2 lhs, bool rhs) { return new bool2 (lhs.x | rhs, lhs.y | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool2 vector.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise bitwise or.</param>
/// <returns>bool2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator | (bool lhs, bool2 rhs) { return new bool2 (lhs | rhs.x, lhs | rhs.y); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool2 vectors.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator ^ (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x ^ rhs.x, lhs.y ^ rhs.y); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool2 vector and a bool value.</summary>
/// <param name="lhs">Left hand side bool2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator ^ (bool2 lhs, bool rhs) { return new bool2 (lhs.x ^ rhs, lhs.y ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2 vector.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator ^ (bool lhs, bool2 rhs) { return new bool2 (lhs ^ rhs.x, lhs ^ rhs.y); }
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 xxxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(x, x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 xxxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(x, x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 xxyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(x, x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 xxyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(x, x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 xyxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(x, y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 xyxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(x, y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 xyyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(x, y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 xyyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(x, y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 yxxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(y, x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 yxxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(y, x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 yxyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(y, x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 yxyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(y, x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 yyxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(y, y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 yyxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(y, y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 yyyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(y, y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool4 yyyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool4(y, y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool3 xxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool3(x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool3 xxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool3(x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool3 xyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool3(x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool3 xyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool3(x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool3 yxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool3(y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool3 yxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool3(y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool3 yyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool3(y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool3 yyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool3(y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool2 xx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool2(x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool2 xy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool2(x, y); }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
set { x = value.x; y = value.y; }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool2 yx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool2(y, x); }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
set { y = value.x; x = value.y; }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool2 yy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new bool2(y, y); }
}
/// <summary>Returns the bool element at a specified index.</summary>
unsafe public bool this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (bool2* array = &this) { return ((bool*)array)[index]; }
}
set
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (bool* array = &x) { array[index] = value; }
}
}
/// <summary>Returns true if the bool2 is equal to a given bool2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool2 rhs) { return x == rhs.x && y == rhs.y; }
/// <summary>Returns true if the bool2 is equal to a given bool2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool2 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool2({0}, {1})", x, y);
}
internal sealed class DebuggerProxy
{
public bool x;
public bool y;
public DebuggerProxy(bool2 v)
{
x = v.x;
y = v.y;
}
}
}
public static partial class math
{
/// <summary>Returns a bool2 vector constructed from two bool values.</summary>
/// <param name="x">The constructed vector's x component will be set to this value.</param>
/// <param name="y">The constructed vector's y component will be set to this value.</param>
/// <returns>bool2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 bool2(bool x, bool y) { return new bool2(x, y); }
/// <summary>Returns a bool2 vector constructed from a bool2 vector.</summary>
/// <param name="xy">The constructed vector's xy components will be set to this value.</param>
/// <returns>bool2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 bool2(bool2 xy) { return new bool2(xy); }
/// <summary>Returns a bool2 vector constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 bool2(bool v) { return new bool2(v); }
/// <summary>Returns a uint hash code of a bool2 vector.</summary>
/// <param name="v">Vector value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool2 v)
{
return csum(select(uint2(0x90A285BBu, 0x5D19E1D5u), uint2(0xFAAF07DDu, 0x625C45BDu), v));
}
/// <summary>
/// Returns a uint2 vector hash code of a bool2 vector.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Vector value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(bool2 v)
{
return (select(uint2(0xC9F27FCBu, 0x6D2523B1u), uint2(0x6E2BF6A9u, 0xCC74B3B7u), v));
}
/// <summary>Returns the result of specified shuffling of the components from two bool2 vectors into a bool value.</summary>
/// <param name="left">bool2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">bool2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting bool.</param>
/// <returns>bool result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool shuffle(bool2 left, bool2 right, ShuffleComponent x)
{
return select_shuffle_component(left, right, x);
}
/// <summary>Returns the result of specified shuffling of the components from two bool2 vectors into a bool2 vector.</summary>
/// <param name="left">bool2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">bool2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting bool2 x component.</param>
/// <param name="y">The ShuffleComponent to use when setting the resulting bool2 y component.</param>
/// <returns>bool2 result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 shuffle(bool2 left, bool2 right, ShuffleComponent x, ShuffleComponent y)
{
return bool2(
select_shuffle_component(left, right, x),
select_shuffle_component(left, right, y));
}
/// <summary>Returns the result of specified shuffling of the components from two bool2 vectors into a bool3 vector.</summary>
/// <param name="left">bool2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">bool2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting bool3 x component.</param>
/// <param name="y">The ShuffleComponent to use when setting the resulting bool3 y component.</param>
/// <param name="z">The ShuffleComponent to use when setting the resulting bool3 z component.</param>
/// <returns>bool3 result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3 shuffle(bool2 left, bool2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
{
return bool3(
select_shuffle_component(left, right, x),
select_shuffle_component(left, right, y),
select_shuffle_component(left, right, z));
}
/// <summary>Returns the result of specified shuffling of the components from two bool2 vectors into a bool4 vector.</summary>
/// <param name="left">bool2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">bool2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting bool4 x component.</param>
/// <param name="y">The ShuffleComponent to use when setting the resulting bool4 y component.</param>
/// <param name="z">The ShuffleComponent to use when setting the resulting bool4 z component.</param>
/// <param name="w">The ShuffleComponent to use when setting the resulting bool4 w component.</param>
/// <returns>bool4 result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4 shuffle(bool2 left, bool2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
{
return bool4(
select_shuffle_component(left, right, x),
select_shuffle_component(left, right, y),
select_shuffle_component(left, right, z),
select_shuffle_component(left, right, w));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static bool select_shuffle_component(bool2 a, bool2 b, ShuffleComponent component)
{
switch(component)
{
case ShuffleComponent.LeftX:
return a.x;
case ShuffleComponent.LeftY:
return a.y;
case ShuffleComponent.RightX:
return b.x;
case ShuffleComponent.RightY:
return b.y;
default:
throw new System.ArgumentException("Invalid shuffle component: " + component);
}
}
}
}

View File

@@ -0,0 +1,292 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x2 matrix of bools.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool2x2 : System.IEquatable<bool2x2>
{
/// <summary>Column 0 of the matrix.</summary>
public bool2 c0;
/// <summary>Column 1 of the matrix.</summary>
public bool2 c1;
/// <summary>Constructs a bool2x2 matrix from two bool2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2x2(bool2 c0, bool2 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a bool2x2 matrix from 4 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2x2(bool m00, bool m01,
bool m10, bool m11)
{
this.c0 = new bool2(m00, m10);
this.c1 = new bool2(m01, m11);
}
/// <summary>Constructs a bool2x2 matrix from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2x2(bool v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Implicitly converts a single bool value to a bool2x2 matrix by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool2x2(bool v) { return new bool2x2(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool2x2 matrices.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on a bool2x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool2x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two bool2x2 matrices.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on a bool2x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool2x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the result of a componentwise not operation on a bool2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool2x2 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator ! (bool2x2 val) { return new bool2x2 (!val.c0, !val.c1); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool2x2 matrices.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise bitwise and.</param>
/// <returns>bool2x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator & (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool2x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool2x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator & (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 & rhs, lhs.c1 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool2x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise bitwise and.</param>
/// <returns>bool2x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator & (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs & rhs.c0, lhs & rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool2x2 matrices.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise bitwise or.</param>
/// <returns>bool2x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator | (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool2x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool2x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator | (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 | rhs, lhs.c1 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool2x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise bitwise or.</param>
/// <returns>bool2x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator | (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs | rhs.c0, lhs | rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool2x2 matrices.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator ^ (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool2x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator ^ (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool2x2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator ^ (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); }
/// <summary>Returns the bool2 element at a specified index.</summary>
unsafe public ref bool2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (bool2x2* array = &this) { return ref ((bool2*)array)[index]; }
}
}
/// <summary>Returns true if the bool2x2 is equal to a given bool2x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool2x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the bool2x2 is equal to a given bool2x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool2x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool2x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool2x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool2x2({0}, {1}, {2}, {3})", c0.x, c1.x, c0.y, c1.y);
}
}
public static partial class math
{
/// <summary>Returns a bool2x2 matrix constructed from two bool2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>bool2x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 bool2x2(bool2 c0, bool2 c1) { return new bool2x2(c0, c1); }
/// <summary>Returns a bool2x2 matrix constructed from from 4 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <returns>bool2x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 bool2x2(bool m00, bool m01,
bool m10, bool m11)
{
return new bool2x2(m00, m01,
m10, m11);
}
/// <summary>Returns a bool2x2 matrix constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 bool2x2(bool v) { return new bool2x2(v); }
/// <summary>Return the bool2x2 transpose of a bool2x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 transpose(bool2x2 v)
{
return bool2x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y);
}
/// <summary>Returns a uint hash code of a bool2x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool2x2 v)
{
return csum(select(uint2(0x7AF32C49u, 0xAE131389u), uint2(0x5D1B165Bu, 0x87096CD7u), v.c0) +
select(uint2(0x4C7F6DD1u, 0x4822A3E9u), uint2(0xAAC3C25Du, 0xD21D0945u), v.c1));
}
/// <summary>
/// Returns a uint2 vector hash code of a bool2x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(bool2x2 v)
{
return (select(uint2(0x88FCAB2Du, 0x614DA60Du), uint2(0x5BA2C50Bu, 0x8C455ACBu), v.c0) +
select(uint2(0xCD266C89u, 0xF1852A33u), uint2(0x77E35E77u, 0x863E3729u), v.c1));
}
}
}

View File

@@ -0,0 +1,306 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x3 matrix of bools.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool2x3 : System.IEquatable<bool2x3>
{
/// <summary>Column 0 of the matrix.</summary>
public bool2 c0;
/// <summary>Column 1 of the matrix.</summary>
public bool2 c1;
/// <summary>Column 2 of the matrix.</summary>
public bool2 c2;
/// <summary>Constructs a bool2x3 matrix from three bool2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2x3(bool2 c0, bool2 c1, bool2 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a bool2x3 matrix from 6 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2x3(bool m00, bool m01, bool m02,
bool m10, bool m11, bool m12)
{
this.c0 = new bool2(m00, m10);
this.c1 = new bool2(m01, m11);
this.c2 = new bool2(m02, m12);
}
/// <summary>Constructs a bool2x3 matrix from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2x3(bool v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Implicitly converts a single bool value to a bool2x3 matrix by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool2x3(bool v) { return new bool2x3(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool2x3 matrices.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on a bool2x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool2x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two bool2x3 matrices.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on a bool2x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool2x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the result of a componentwise not operation on a bool2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool2x3 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator ! (bool2x3 val) { return new bool2x3 (!val.c0, !val.c1, !val.c2); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool2x3 matrices.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise bitwise and.</param>
/// <returns>bool2x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator & (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool2x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool2x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator & (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool2x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise bitwise and.</param>
/// <returns>bool2x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator & (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool2x3 matrices.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise bitwise or.</param>
/// <returns>bool2x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator | (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool2x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool2x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator | (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool2x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise bitwise or.</param>
/// <returns>bool2x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator | (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool2x3 matrices.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator ^ (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool2x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x3 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator ^ (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool2x3 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator ^ (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); }
/// <summary>Returns the bool2 element at a specified index.</summary>
unsafe public ref bool2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (bool2x3* array = &this) { return ref ((bool2*)array)[index]; }
}
}
/// <summary>Returns true if the bool2x3 is equal to a given bool2x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool2x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the bool2x3 is equal to a given bool2x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool2x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool2x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool2x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y);
}
}
public static partial class math
{
/// <summary>Returns a bool2x3 matrix constructed from three bool2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>bool2x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 bool2x3(bool2 c0, bool2 c1, bool2 c2) { return new bool2x3(c0, c1, c2); }
/// <summary>Returns a bool2x3 matrix constructed from from 6 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <returns>bool2x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 bool2x3(bool m00, bool m01, bool m02,
bool m10, bool m11, bool m12)
{
return new bool2x3(m00, m01, m02,
m10, m11, m12);
}
/// <summary>Returns a bool2x3 matrix constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 bool2x3(bool v) { return new bool2x3(v); }
/// <summary>Return the bool3x2 transpose of a bool2x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 transpose(bool2x3 v)
{
return bool3x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y,
v.c2.x, v.c2.y);
}
/// <summary>Returns a uint hash code of a bool2x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool2x3 v)
{
return csum(select(uint2(0x7BE39F3Bu, 0xFAB9913Fu), uint2(0xB4501269u, 0xE04B89FDu), v.c0) +
select(uint2(0xDB3DE101u, 0x7B6D1B4Bu), uint2(0x58399E77u, 0x5EAC29C9u), v.c1) +
select(uint2(0xFC6014F9u, 0x6BF6693Fu), uint2(0x9D1B1D9Bu, 0xF842F5C1u), v.c2));
}
/// <summary>
/// Returns a uint2 vector hash code of a bool2x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(bool2x3 v)
{
return (select(uint2(0xA47EC335u, 0xA477DF57u), uint2(0xC4B1493Fu, 0xBA0966D3u), v.c0) +
select(uint2(0xAFBEE253u, 0x5B419C01u), uint2(0x515D90F5u, 0xEC9F68F3u), v.c1) +
select(uint2(0xF9EA92D5u, 0xC2FAFCB9u), uint2(0x616E9CA1u, 0xC5C5394Bu), v.c2));
}
}
}

View File

@@ -0,0 +1,320 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x4 matrix of bools.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool2x4 : System.IEquatable<bool2x4>
{
/// <summary>Column 0 of the matrix.</summary>
public bool2 c0;
/// <summary>Column 1 of the matrix.</summary>
public bool2 c1;
/// <summary>Column 2 of the matrix.</summary>
public bool2 c2;
/// <summary>Column 3 of the matrix.</summary>
public bool2 c3;
/// <summary>Constructs a bool2x4 matrix from four bool2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2x4(bool2 c0, bool2 c1, bool2 c2, bool2 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a bool2x4 matrix from 8 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2x4(bool m00, bool m01, bool m02, bool m03,
bool m10, bool m11, bool m12, bool m13)
{
this.c0 = new bool2(m00, m10);
this.c1 = new bool2(m01, m11);
this.c2 = new bool2(m02, m12);
this.c3 = new bool2(m03, m13);
}
/// <summary>Constructs a bool2x4 matrix from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool2x4(bool v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Implicitly converts a single bool value to a bool2x4 matrix by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool2x4(bool v) { return new bool2x4(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool2x4 matrices.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on a bool2x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool2x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two bool2x4 matrices.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on a bool2x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool2x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the result of a componentwise not operation on a bool2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool2x4 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator ! (bool2x4 val) { return new bool2x4 (!val.c0, !val.c1, !val.c2, !val.c3); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool2x4 matrices.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise and.</param>
/// <returns>bool2x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator & (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool2x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool2x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator & (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool2x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise and.</param>
/// <returns>bool2x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator & (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool2x4 matrices.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise or.</param>
/// <returns>bool2x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator | (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool2x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool2x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator | (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool2x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise or.</param>
/// <returns>bool2x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator | (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool2x4 matrices.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator ^ (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool2x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator ^ (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool2x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator ^ (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); }
/// <summary>Returns the bool2 element at a specified index.</summary>
unsafe public ref bool2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (bool2x4* array = &this) { return ref ((bool2*)array)[index]; }
}
}
/// <summary>Returns true if the bool2x4 is equal to a given bool2x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the bool2x4 is equal to a given bool2x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool2x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool2x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool2x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y);
}
}
public static partial class math
{
/// <summary>Returns a bool2x4 matrix constructed from four bool2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>bool2x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 bool2x4(bool2 c0, bool2 c1, bool2 c2, bool2 c3) { return new bool2x4(c0, c1, c2, c3); }
/// <summary>Returns a bool2x4 matrix constructed from from 8 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <returns>bool2x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 bool2x4(bool m00, bool m01, bool m02, bool m03,
bool m10, bool m11, bool m12, bool m13)
{
return new bool2x4(m00, m01, m02, m03,
m10, m11, m12, m13);
}
/// <summary>Returns a bool2x4 matrix constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 bool2x4(bool v) { return new bool2x4(v); }
/// <summary>Return the bool4x2 transpose of a bool2x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 transpose(bool2x4 v)
{
return bool4x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y,
v.c2.x, v.c2.y,
v.c3.x, v.c3.y);
}
/// <summary>Returns a uint hash code of a bool2x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool2x4 v)
{
return csum(select(uint2(0x45A22087u, 0xFC104C3Bu), uint2(0x5FFF6B19u, 0x5E6CBF3Bu), v.c0) +
select(uint2(0xB546F2A5u, 0xBBCF63E7u), uint2(0xC53F4755u, 0x6985C229u), v.c1) +
select(uint2(0xE133B0B3u, 0xC3E0A3B9u), uint2(0xFE31134Fu, 0x712A34D7u), v.c2) +
select(uint2(0x9D77A59Bu, 0x4942CA39u), uint2(0xB40EC62Du, 0x565ED63Fu), v.c3));
}
/// <summary>
/// Returns a uint2 vector hash code of a bool2x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(bool2x4 v)
{
return (select(uint2(0x93C30C2Bu, 0xDCAF0351u), uint2(0x6E050B01u, 0x750FDBF5u), v.c0) +
select(uint2(0x7F3DD499u, 0x52EAAEBBu), uint2(0x4599C793u, 0x83B5E729u), v.c1) +
select(uint2(0xC267163Fu, 0x67BC9149u), uint2(0xAD7C5EC1u, 0x822A7D6Du), v.c2) +
select(uint2(0xB492BF15u, 0xD37220E3u), uint2(0x7AA2C2BDu, 0xE16BC89Du), v.c3));
}
}
}

1497
ThirdParty/Unity.Mathematics/bool3.gen.cs vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,299 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 3x2 matrix of bools.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool3x2 : System.IEquatable<bool3x2>
{
/// <summary>Column 0 of the matrix.</summary>
public bool3 c0;
/// <summary>Column 1 of the matrix.</summary>
public bool3 c1;
/// <summary>Constructs a bool3x2 matrix from two bool3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool3x2(bool3 c0, bool3 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a bool3x2 matrix from 6 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool3x2(bool m00, bool m01,
bool m10, bool m11,
bool m20, bool m21)
{
this.c0 = new bool3(m00, m10, m20);
this.c1 = new bool3(m01, m11, m21);
}
/// <summary>Constructs a bool3x2 matrix from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool3x2(bool v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Implicitly converts a single bool value to a bool3x2 matrix by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool3x2(bool v) { return new bool3x2(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool3x2 matrices.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise equality.</param>
/// <returns>bool3x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator == (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on a bool3x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool3x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator == (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool3x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise equality.</param>
/// <returns>bool3x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator == (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two bool3x2 matrices.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise not equal.</param>
/// <returns>bool3x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator != (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on a bool3x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool3x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator != (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool3x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise not equal.</param>
/// <returns>bool3x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator != (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the result of a componentwise not operation on a bool3x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool3x2 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator ! (bool3x2 val) { return new bool3x2 (!val.c0, !val.c1); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool3x2 matrices.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise bitwise and.</param>
/// <returns>bool3x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator & (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool3x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool3x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator & (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 & rhs, lhs.c1 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool3x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise bitwise and.</param>
/// <returns>bool3x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator & (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs & rhs.c0, lhs & rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool3x2 matrices.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise bitwise or.</param>
/// <returns>bool3x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator | (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool3x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool3x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator | (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 | rhs, lhs.c1 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool3x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise bitwise or.</param>
/// <returns>bool3x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator | (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs | rhs.c0, lhs | rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool3x2 matrices.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool3x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator ^ (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool3x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool3x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator ^ (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool3x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool3x2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool3x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator ^ (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); }
/// <summary>Returns the bool3 element at a specified index.</summary>
unsafe public ref bool3 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (bool3x2* array = &this) { return ref ((bool3*)array)[index]; }
}
}
/// <summary>Returns true if the bool3x2 is equal to a given bool3x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the bool3x2 is equal to a given bool3x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool3x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool3x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool3x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z);
}
}
public static partial class math
{
/// <summary>Returns a bool3x2 matrix constructed from two bool3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>bool3x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 bool3x2(bool3 c0, bool3 c1) { return new bool3x2(c0, c1); }
/// <summary>Returns a bool3x2 matrix constructed from from 6 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <returns>bool3x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 bool3x2(bool m00, bool m01,
bool m10, bool m11,
bool m20, bool m21)
{
return new bool3x2(m00, m01,
m10, m11,
m20, m21);
}
/// <summary>Returns a bool3x2 matrix constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 bool3x2(bool v) { return new bool3x2(v); }
/// <summary>Return the bool2x3 transpose of a bool3x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 transpose(bool3x2 v)
{
return bool2x3(
v.c0.x, v.c0.y, v.c0.z,
v.c1.x, v.c1.y, v.c1.z);
}
/// <summary>Returns a uint hash code of a bool3x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool3x2 v)
{
return csum(select(uint3(0x9C9F0823u, 0x5A9CA13Bu, 0xAFCDD5EFu), uint3(0xA88D187Du, 0xCF6EBA1Du, 0x9D88E5A1u), v.c0) +
select(uint3(0xEADF0775u, 0x747A9D7Bu, 0x4111F799u), uint3(0xB5F05AF1u, 0xFD80290Bu, 0x8B65ADB7u), v.c1));
}
/// <summary>
/// Returns a uint3 vector hash code of a bool3x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint3 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint3 hashwide(bool3x2 v)
{
return (select(uint3(0xDFF4F563u, 0x7069770Du, 0xD1224537u), uint3(0xE99ED6F3u, 0x48125549u, 0xEEE2123Bu), v.c0) +
select(uint3(0xE3AD9FE5u, 0xCE1CF8BFu, 0x7BE39F3Bu), uint3(0xFAB9913Fu, 0xB4501269u, 0xE04B89FDu), v.c1));
}
}
}

View File

@@ -0,0 +1,315 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 3x3 matrix of bools.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool3x3 : System.IEquatable<bool3x3>
{
/// <summary>Column 0 of the matrix.</summary>
public bool3 c0;
/// <summary>Column 1 of the matrix.</summary>
public bool3 c1;
/// <summary>Column 2 of the matrix.</summary>
public bool3 c2;
/// <summary>Constructs a bool3x3 matrix from three bool3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool3x3(bool3 c0, bool3 c1, bool3 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a bool3x3 matrix from 9 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool3x3(bool m00, bool m01, bool m02,
bool m10, bool m11, bool m12,
bool m20, bool m21, bool m22)
{
this.c0 = new bool3(m00, m10, m20);
this.c1 = new bool3(m01, m11, m21);
this.c2 = new bool3(m02, m12, m22);
}
/// <summary>Constructs a bool3x3 matrix from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool3x3(bool v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Implicitly converts a single bool value to a bool3x3 matrix by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool3x3(bool v) { return new bool3x3(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool3x3 matrices.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise equality.</param>
/// <returns>bool3x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator == (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on a bool3x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool3x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator == (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool3x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise equality.</param>
/// <returns>bool3x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator == (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two bool3x3 matrices.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise not equal.</param>
/// <returns>bool3x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator != (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on a bool3x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool3x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator != (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool3x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise not equal.</param>
/// <returns>bool3x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator != (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the result of a componentwise not operation on a bool3x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool3x3 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator ! (bool3x3 val) { return new bool3x3 (!val.c0, !val.c1, !val.c2); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool3x3 matrices.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise bitwise and.</param>
/// <returns>bool3x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator & (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool3x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool3x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator & (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool3x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise bitwise and.</param>
/// <returns>bool3x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator & (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool3x3 matrices.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise bitwise or.</param>
/// <returns>bool3x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator | (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool3x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool3x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator | (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool3x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise bitwise or.</param>
/// <returns>bool3x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator | (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool3x3 matrices.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool3x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator ^ (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool3x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x3 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool3x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator ^ (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool3x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool3x3 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool3x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator ^ (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); }
/// <summary>Returns the bool3 element at a specified index.</summary>
unsafe public ref bool3 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (bool3x3* array = &this) { return ref ((bool3*)array)[index]; }
}
}
/// <summary>Returns true if the bool3x3 is equal to a given bool3x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool3x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the bool3x3 is equal to a given bool3x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool3x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool3x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool3x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z);
}
}
public static partial class math
{
/// <summary>Returns a bool3x3 matrix constructed from three bool3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>bool3x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 bool3x3(bool3 c0, bool3 c1, bool3 c2) { return new bool3x3(c0, c1, c2); }
/// <summary>Returns a bool3x3 matrix constructed from from 9 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <returns>bool3x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 bool3x3(bool m00, bool m01, bool m02,
bool m10, bool m11, bool m12,
bool m20, bool m21, bool m22)
{
return new bool3x3(m00, m01, m02,
m10, m11, m12,
m20, m21, m22);
}
/// <summary>Returns a bool3x3 matrix constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 bool3x3(bool v) { return new bool3x3(v); }
/// <summary>Return the bool3x3 transpose of a bool3x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 transpose(bool3x3 v)
{
return bool3x3(
v.c0.x, v.c0.y, v.c0.z,
v.c1.x, v.c1.y, v.c1.z,
v.c2.x, v.c2.y, v.c2.z);
}
/// <summary>Returns a uint hash code of a bool3x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool3x3 v)
{
return csum(select(uint3(0xE7579997u, 0xEF7D56C7u, 0x66F38F0Bu), uint3(0x624256A3u, 0x5292ADE1u, 0xD2E590E5u), v.c0) +
select(uint3(0xF25BE857u, 0x9BC17CE7u, 0xC8B86851u), uint3(0x64095221u, 0xADF428FFu, 0xA3977109u), v.c1) +
select(uint3(0x745ED837u, 0x9CDC88F5u, 0xFA62D721u), uint3(0x7E4DB1CFu, 0x68EEE0F5u, 0xBC3B0A59u), v.c2));
}
/// <summary>
/// Returns a uint3 vector hash code of a bool3x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint3 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint3 hashwide(bool3x3 v)
{
return (select(uint3(0x816EFB5Du, 0xA24E82B7u, 0x45A22087u), uint3(0xFC104C3Bu, 0x5FFF6B19u, 0x5E6CBF3Bu), v.c0) +
select(uint3(0xB546F2A5u, 0xBBCF63E7u, 0xC53F4755u), uint3(0x6985C229u, 0xE133B0B3u, 0xC3E0A3B9u), v.c1) +
select(uint3(0xFE31134Fu, 0x712A34D7u, 0x9D77A59Bu), uint3(0x4942CA39u, 0xB40EC62Du, 0x565ED63Fu), v.c2));
}
}
}

View File

@@ -0,0 +1,331 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 3x4 matrix of bools.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool3x4 : System.IEquatable<bool3x4>
{
/// <summary>Column 0 of the matrix.</summary>
public bool3 c0;
/// <summary>Column 1 of the matrix.</summary>
public bool3 c1;
/// <summary>Column 2 of the matrix.</summary>
public bool3 c2;
/// <summary>Column 3 of the matrix.</summary>
public bool3 c3;
/// <summary>Constructs a bool3x4 matrix from four bool3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool3x4(bool3 c0, bool3 c1, bool3 c2, bool3 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a bool3x4 matrix from 12 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool3x4(bool m00, bool m01, bool m02, bool m03,
bool m10, bool m11, bool m12, bool m13,
bool m20, bool m21, bool m22, bool m23)
{
this.c0 = new bool3(m00, m10, m20);
this.c1 = new bool3(m01, m11, m21);
this.c2 = new bool3(m02, m12, m22);
this.c3 = new bool3(m03, m13, m23);
}
/// <summary>Constructs a bool3x4 matrix from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool3x4(bool v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Implicitly converts a single bool value to a bool3x4 matrix by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool3x4(bool v) { return new bool3x4(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool3x4 matrices.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise equality.</param>
/// <returns>bool3x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator == (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on a bool3x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool3x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator == (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool3x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise equality.</param>
/// <returns>bool3x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator == (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two bool3x4 matrices.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise not equal.</param>
/// <returns>bool3x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator != (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on a bool3x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool3x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator != (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool3x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise not equal.</param>
/// <returns>bool3x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator != (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the result of a componentwise not operation on a bool3x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool3x4 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator ! (bool3x4 val) { return new bool3x4 (!val.c0, !val.c1, !val.c2, !val.c3); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool3x4 matrices.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise and.</param>
/// <returns>bool3x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator & (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool3x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool3x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator & (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool3x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise and.</param>
/// <returns>bool3x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator & (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool3x4 matrices.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise or.</param>
/// <returns>bool3x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator | (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool3x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool3x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator | (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool3x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise or.</param>
/// <returns>bool3x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator | (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool3x4 matrices.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool3x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator ^ (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool3x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool3x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator ^ (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool3x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool3x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator ^ (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); }
/// <summary>Returns the bool3 element at a specified index.</summary>
unsafe public ref bool3 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (bool3x4* array = &this) { return ref ((bool3*)array)[index]; }
}
}
/// <summary>Returns true if the bool3x4 is equal to a given bool3x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the bool3x4 is equal to a given bool3x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool3x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool3x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool3x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z);
}
}
public static partial class math
{
/// <summary>Returns a bool3x4 matrix constructed from four bool3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>bool3x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 bool3x4(bool3 c0, bool3 c1, bool3 c2, bool3 c3) { return new bool3x4(c0, c1, c2, c3); }
/// <summary>Returns a bool3x4 matrix constructed from from 12 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
/// <returns>bool3x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 bool3x4(bool m00, bool m01, bool m02, bool m03,
bool m10, bool m11, bool m12, bool m13,
bool m20, bool m21, bool m22, bool m23)
{
return new bool3x4(m00, m01, m02, m03,
m10, m11, m12, m13,
m20, m21, m22, m23);
}
/// <summary>Returns a bool3x4 matrix constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 bool3x4(bool v) { return new bool3x4(v); }
/// <summary>Return the bool4x3 transpose of a bool3x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 transpose(bool3x4 v)
{
return bool4x3(
v.c0.x, v.c0.y, v.c0.z,
v.c1.x, v.c1.y, v.c1.z,
v.c2.x, v.c2.y, v.c2.z,
v.c3.x, v.c3.y, v.c3.z);
}
/// <summary>Returns a uint hash code of a bool3x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool3x4 v)
{
return csum(select(uint3(0x83B58237u, 0x833E3E29u, 0xA9D919BFu), uint3(0xC3EC1D97u, 0xB8B208C7u, 0x5D3ED947u), v.c0) +
select(uint3(0x4473BBB1u, 0xCBA11D5Fu, 0x685835CFu), uint3(0xC3D32AE1u, 0xB966942Fu, 0xFE9856B3u), v.c1) +
select(uint3(0xFA3A3285u, 0xAD55999Du, 0xDCDD5341u), uint3(0x94DDD769u, 0xA1E92D39u, 0x4583C801u), v.c2) +
select(uint3(0x9536A0F5u, 0xAF816615u, 0x9AF8D62Du), uint3(0xE3600729u, 0x5F17300Du, 0x670D6809u), v.c3));
}
/// <summary>
/// Returns a uint3 vector hash code of a bool3x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint3 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint3 hashwide(bool3x4 v)
{
return (select(uint3(0x7AF32C49u, 0xAE131389u, 0x5D1B165Bu), uint3(0x87096CD7u, 0x4C7F6DD1u, 0x4822A3E9u), v.c0) +
select(uint3(0xAAC3C25Du, 0xD21D0945u, 0x88FCAB2Du), uint3(0x614DA60Du, 0x5BA2C50Bu, 0x8C455ACBu), v.c1) +
select(uint3(0xCD266C89u, 0xF1852A33u, 0x77E35E77u), uint3(0x863E3729u, 0xE191B035u, 0x68586FAFu), v.c2) +
select(uint3(0xD4DFF6D3u, 0xCB634F4Du, 0x9B13B92Du), uint3(0x4ABF0813u, 0x86068063u, 0xD75513F9u), v.c3));
}
}
}

3662
ThirdParty/Unity.Mathematics/bool4.gen.cs vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,306 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 4x2 matrix of bools.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool4x2 : System.IEquatable<bool4x2>
{
/// <summary>Column 0 of the matrix.</summary>
public bool4 c0;
/// <summary>Column 1 of the matrix.</summary>
public bool4 c1;
/// <summary>Constructs a bool4x2 matrix from two bool4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool4x2(bool4 c0, bool4 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a bool4x2 matrix from 8 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool4x2(bool m00, bool m01,
bool m10, bool m11,
bool m20, bool m21,
bool m30, bool m31)
{
this.c0 = new bool4(m00, m10, m20, m30);
this.c1 = new bool4(m01, m11, m21, m31);
}
/// <summary>Constructs a bool4x2 matrix from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool4x2(bool v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Implicitly converts a single bool value to a bool4x2 matrix by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool4x2(bool v) { return new bool4x2(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool4x2 matrices.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise equality.</param>
/// <returns>bool4x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator == (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on a bool4x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool4x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator == (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool4x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise equality.</param>
/// <returns>bool4x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator == (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two bool4x2 matrices.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise not equal.</param>
/// <returns>bool4x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator != (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on a bool4x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool4x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator != (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool4x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise not equal.</param>
/// <returns>bool4x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator != (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the result of a componentwise not operation on a bool4x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool4x2 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator ! (bool4x2 val) { return new bool4x2 (!val.c0, !val.c1); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool4x2 matrices.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise bitwise and.</param>
/// <returns>bool4x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator & (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool4x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool4x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator & (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 & rhs, lhs.c1 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool4x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise bitwise and.</param>
/// <returns>bool4x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator & (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs & rhs.c0, lhs & rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool4x2 matrices.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise bitwise or.</param>
/// <returns>bool4x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator | (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool4x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool4x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator | (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 | rhs, lhs.c1 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool4x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise bitwise or.</param>
/// <returns>bool4x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator | (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs | rhs.c0, lhs | rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool4x2 matrices.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool4x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator ^ (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool4x2 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool4x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator ^ (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool4x2 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool4x2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool4x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator ^ (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); }
/// <summary>Returns the bool4 element at a specified index.</summary>
unsafe public ref bool4 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (bool4x2* array = &this) { return ref ((bool4*)array)[index]; }
}
}
/// <summary>Returns true if the bool4x2 is equal to a given bool4x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool4x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the bool4x2 is equal to a given bool4x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool4x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool4x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool4x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z, c0.w, c1.w);
}
}
public static partial class math
{
/// <summary>Returns a bool4x2 matrix constructed from two bool4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>bool4x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 bool4x2(bool4 c0, bool4 c1) { return new bool4x2(c0, c1); }
/// <summary>Returns a bool4x2 matrix constructed from from 8 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <returns>bool4x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 bool4x2(bool m00, bool m01,
bool m10, bool m11,
bool m20, bool m21,
bool m30, bool m31)
{
return new bool4x2(m00, m01,
m10, m11,
m20, m21,
m30, m31);
}
/// <summary>Returns a bool4x2 matrix constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 bool4x2(bool v) { return new bool4x2(v); }
/// <summary>Return the bool2x4 transpose of a bool4x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 transpose(bool4x2 v)
{
return bool2x4(
v.c0.x, v.c0.y, v.c0.z, v.c0.w,
v.c1.x, v.c1.y, v.c1.z, v.c1.w);
}
/// <summary>Returns a uint hash code of a bool4x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool4x2 v)
{
return csum(select(uint4(0xD19764C7u, 0xB5D0BF63u, 0xF9102C5Fu, 0x9881FB9Fu), uint4(0x56A1530Du, 0x804B722Du, 0x738E50E5u, 0x4FC93C25u), v.c0) +
select(uint4(0xCD0445A5u, 0xD2B90D9Bu, 0xD35C9B2Du, 0xA10D9E27u), uint4(0x568DAAA9u, 0x7530254Fu, 0x9F090439u, 0x5E9F85C9u), v.c1));
}
/// <summary>
/// Returns a uint4 vector hash code of a bool4x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint4 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(bool4x2 v)
{
return (select(uint4(0x8C4CA03Fu, 0xB8D969EDu, 0xAC5DB57Bu, 0xA91A02EDu), uint4(0xB3C49313u, 0xF43A9ABBu, 0x84E7E01Bu, 0x8E055BE5u), v.c0) +
select(uint4(0x6E624EB7u, 0x7383ED49u, 0xDD49C23Bu, 0xEBD0D005u), uint4(0x91475DF7u, 0x55E84827u, 0x90A285BBu, 0x5D19E1D5u), v.c1));
}
}
}

View File

@@ -0,0 +1,324 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 4x3 matrix of bools.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool4x3 : System.IEquatable<bool4x3>
{
/// <summary>Column 0 of the matrix.</summary>
public bool4 c0;
/// <summary>Column 1 of the matrix.</summary>
public bool4 c1;
/// <summary>Column 2 of the matrix.</summary>
public bool4 c2;
/// <summary>Constructs a bool4x3 matrix from three bool4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool4x3(bool4 c0, bool4 c1, bool4 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a bool4x3 matrix from 12 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool4x3(bool m00, bool m01, bool m02,
bool m10, bool m11, bool m12,
bool m20, bool m21, bool m22,
bool m30, bool m31, bool m32)
{
this.c0 = new bool4(m00, m10, m20, m30);
this.c1 = new bool4(m01, m11, m21, m31);
this.c2 = new bool4(m02, m12, m22, m32);
}
/// <summary>Constructs a bool4x3 matrix from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool4x3(bool v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Implicitly converts a single bool value to a bool4x3 matrix by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool4x3(bool v) { return new bool4x3(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool4x3 matrices.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise equality.</param>
/// <returns>bool4x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator == (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on a bool4x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool4x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator == (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool4x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise equality.</param>
/// <returns>bool4x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator == (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two bool4x3 matrices.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise not equal.</param>
/// <returns>bool4x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator != (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on a bool4x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool4x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator != (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool4x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise not equal.</param>
/// <returns>bool4x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator != (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the result of a componentwise not operation on a bool4x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool4x3 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator ! (bool4x3 val) { return new bool4x3 (!val.c0, !val.c1, !val.c2); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool4x3 matrices.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise bitwise and.</param>
/// <returns>bool4x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator & (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool4x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool4x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator & (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool4x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise bitwise and.</param>
/// <returns>bool4x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator & (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool4x3 matrices.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise bitwise or.</param>
/// <returns>bool4x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator | (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool4x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool4x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator | (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool4x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise bitwise or.</param>
/// <returns>bool4x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator | (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool4x3 matrices.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool4x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator ^ (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool4x3 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x3 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool4x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator ^ (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool4x3 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool4x3 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool4x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator ^ (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); }
/// <summary>Returns the bool4 element at a specified index.</summary>
unsafe public ref bool4 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (bool4x3* array = &this) { return ref ((bool4*)array)[index]; }
}
}
/// <summary>Returns true if the bool4x3 is equal to a given bool4x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool4x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the bool4x3 is equal to a given bool4x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool4x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool4x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool4x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z, c0.w, c1.w, c2.w);
}
}
public static partial class math
{
/// <summary>Returns a bool4x3 matrix constructed from three bool4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>bool4x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 bool4x3(bool4 c0, bool4 c1, bool4 c2) { return new bool4x3(c0, c1, c2); }
/// <summary>Returns a bool4x3 matrix constructed from from 12 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
/// <returns>bool4x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 bool4x3(bool m00, bool m01, bool m02,
bool m10, bool m11, bool m12,
bool m20, bool m21, bool m22,
bool m30, bool m31, bool m32)
{
return new bool4x3(m00, m01, m02,
m10, m11, m12,
m20, m21, m22,
m30, m31, m32);
}
/// <summary>Returns a bool4x3 matrix constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 bool4x3(bool v) { return new bool4x3(v); }
/// <summary>Return the bool3x4 transpose of a bool4x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 transpose(bool4x3 v)
{
return bool3x4(
v.c0.x, v.c0.y, v.c0.z, v.c0.w,
v.c1.x, v.c1.y, v.c1.z, v.c1.w,
v.c2.x, v.c2.y, v.c2.z, v.c2.w);
}
/// <summary>Returns a uint hash code of a bool4x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool4x3 v)
{
return csum(select(uint4(0xEADF0775u, 0x747A9D7Bu, 0x4111F799u, 0xB5F05AF1u), uint4(0xFD80290Bu, 0x8B65ADB7u, 0xDFF4F563u, 0x7069770Du), v.c0) +
select(uint4(0xD1224537u, 0xE99ED6F3u, 0x48125549u, 0xEEE2123Bu), uint4(0xE3AD9FE5u, 0xCE1CF8BFu, 0x7BE39F3Bu, 0xFAB9913Fu), v.c1) +
select(uint4(0xB4501269u, 0xE04B89FDu, 0xDB3DE101u, 0x7B6D1B4Bu), uint4(0x58399E77u, 0x5EAC29C9u, 0xFC6014F9u, 0x6BF6693Fu), v.c2));
}
/// <summary>
/// Returns a uint4 vector hash code of a bool4x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint4 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(bool4x3 v)
{
return (select(uint4(0x9D1B1D9Bu, 0xF842F5C1u, 0xA47EC335u, 0xA477DF57u), uint4(0xC4B1493Fu, 0xBA0966D3u, 0xAFBEE253u, 0x5B419C01u), v.c0) +
select(uint4(0x515D90F5u, 0xEC9F68F3u, 0xF9EA92D5u, 0xC2FAFCB9u), uint4(0x616E9CA1u, 0xC5C5394Bu, 0xCAE78587u, 0x7A1541C9u), v.c1) +
select(uint4(0xF83BD927u, 0x6A243BCBu, 0x509B84C9u, 0x91D13847u), uint4(0x52F7230Fu, 0xCF286E83u, 0xE121E6ADu, 0xC9CA1249u), v.c2));
}
}
}

View File

@@ -0,0 +1,342 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 4x4 matrix of bools.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct bool4x4 : System.IEquatable<bool4x4>
{
/// <summary>Column 0 of the matrix.</summary>
public bool4 c0;
/// <summary>Column 1 of the matrix.</summary>
public bool4 c1;
/// <summary>Column 2 of the matrix.</summary>
public bool4 c2;
/// <summary>Column 3 of the matrix.</summary>
public bool4 c3;
/// <summary>Constructs a bool4x4 matrix from four bool4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool4x4(bool4 c0, bool4 c1, bool4 c2, bool4 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a bool4x4 matrix from 16 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
/// <param name="m33">The matrix at row 3, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool4x4(bool m00, bool m01, bool m02, bool m03,
bool m10, bool m11, bool m12, bool m13,
bool m20, bool m21, bool m22, bool m23,
bool m30, bool m31, bool m32, bool m33)
{
this.c0 = new bool4(m00, m10, m20, m30);
this.c1 = new bool4(m01, m11, m21, m31);
this.c2 = new bool4(m02, m12, m22, m32);
this.c3 = new bool4(m03, m13, m23, m33);
}
/// <summary>Constructs a bool4x4 matrix from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool4x4(bool v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Implicitly converts a single bool value to a bool4x4 matrix by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator bool4x4(bool v) { return new bool4x4(v); }
/// <summary>Returns the result of a componentwise equality operation on two bool4x4 matrices.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise equality.</param>
/// <returns>bool4x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator == (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on a bool4x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
/// <returns>bool4x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator == (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a bool value and a bool4x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise equality.</param>
/// <returns>bool4x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator == (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two bool4x4 matrices.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise not equal.</param>
/// <returns>bool4x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator != (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on a bool4x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
/// <returns>bool4x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator != (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool4x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise not equal.</param>
/// <returns>bool4x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator != (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the result of a componentwise not operation on a bool4x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise not.</param>
/// <returns>bool4x4 result of the componentwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator ! (bool4x4 val) { return new bool4x4 (!val.c0, !val.c1, !val.c2, !val.c3); }
/// <summary>Returns the result of a componentwise bitwise and operation on two bool4x4 matrices.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise bitwise and.</param>
/// <returns>bool4x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator & (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool4x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
/// <returns>bool4x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator & (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool4x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise bitwise and.</param>
/// <returns>bool4x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator & (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise or operation on two bool4x4 matrices.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise bitwise or.</param>
/// <returns>bool4x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator | (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool4x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
/// <returns>bool4x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator | (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool4x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise bitwise or.</param>
/// <returns>bool4x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator | (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool4x4 matrices.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool4x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator ^ (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool4x4 matrix and a bool value.</summary>
/// <param name="lhs">Left hand side bool4x4 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool4x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator ^ (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool4x4 matrix.</summary>
/// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side bool4x4 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>bool4x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator ^ (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); }
/// <summary>Returns the bool4 element at a specified index.</summary>
unsafe public ref bool4 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (bool4x4* array = &this) { return ref ((bool4*)array)[index]; }
}
}
/// <summary>Returns true if the bool4x4 is equal to a given bool4x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(bool4x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the bool4x4 is equal to a given bool4x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is bool4x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the bool4x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the bool4x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("bool4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z, c0.w, c1.w, c2.w, c3.w);
}
}
public static partial class math
{
/// <summary>Returns a bool4x4 matrix constructed from four bool4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>bool4x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 bool4x4(bool4 c0, bool4 c1, bool4 c2, bool4 c3) { return new bool4x4(c0, c1, c2, c3); }
/// <summary>Returns a bool4x4 matrix constructed from from 16 bool values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
/// <param name="m33">The matrix at row 3, column 3 will be set to this value.</param>
/// <returns>bool4x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 bool4x4(bool m00, bool m01, bool m02, bool m03,
bool m10, bool m11, bool m12, bool m13,
bool m20, bool m21, bool m22, bool m23,
bool m30, bool m31, bool m32, bool m33)
{
return new bool4x4(m00, m01, m02, m03,
m10, m11, m12, m13,
m20, m21, m22, m23,
m30, m31, m32, m33);
}
/// <summary>Returns a bool4x4 matrix constructed from a single bool value by assigning it to every component.</summary>
/// <param name="v">bool to convert to bool4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 bool4x4(bool v) { return new bool4x4(v); }
/// <summary>Return the bool4x4 transpose of a bool4x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 transpose(bool4x4 v)
{
return bool4x4(
v.c0.x, v.c0.y, v.c0.z, v.c0.w,
v.c1.x, v.c1.y, v.c1.z, v.c1.w,
v.c2.x, v.c2.y, v.c2.z, v.c2.w,
v.c3.x, v.c3.y, v.c3.z, v.c3.w);
}
/// <summary>Returns a uint hash code of a bool4x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(bool4x4 v)
{
return csum(select(uint4(0xD19764C7u, 0xB5D0BF63u, 0xF9102C5Fu, 0x9881FB9Fu), uint4(0x56A1530Du, 0x804B722Du, 0x738E50E5u, 0x4FC93C25u), v.c0) +
select(uint4(0xCD0445A5u, 0xD2B90D9Bu, 0xD35C9B2Du, 0xA10D9E27u), uint4(0x568DAAA9u, 0x7530254Fu, 0x9F090439u, 0x5E9F85C9u), v.c1) +
select(uint4(0x8C4CA03Fu, 0xB8D969EDu, 0xAC5DB57Bu, 0xA91A02EDu), uint4(0xB3C49313u, 0xF43A9ABBu, 0x84E7E01Bu, 0x8E055BE5u), v.c2) +
select(uint4(0x6E624EB7u, 0x7383ED49u, 0xDD49C23Bu, 0xEBD0D005u), uint4(0x91475DF7u, 0x55E84827u, 0x90A285BBu, 0x5D19E1D5u), v.c3));
}
/// <summary>
/// Returns a uint4 vector hash code of a bool4x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint4 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(bool4x4 v)
{
return (select(uint4(0xFAAF07DDu, 0x625C45BDu, 0xC9F27FCBu, 0x6D2523B1u), uint4(0x6E2BF6A9u, 0xCC74B3B7u, 0x83B58237u, 0x833E3E29u), v.c0) +
select(uint4(0xA9D919BFu, 0xC3EC1D97u, 0xB8B208C7u, 0x5D3ED947u), uint4(0x4473BBB1u, 0xCBA11D5Fu, 0x685835CFu, 0xC3D32AE1u), v.c1) +
select(uint4(0xB966942Fu, 0xFE9856B3u, 0xFA3A3285u, 0xAD55999Du), uint4(0xDCDD5341u, 0x94DDD769u, 0xA1E92D39u, 0x4583C801u), v.c2) +
select(uint4(0x9536A0F5u, 0xAF816615u, 0x9AF8D62Du, 0xE3600729u), uint4(0x5F17300Du, 0x670D6809u, 0x7AF32C49u, 0xAE131389u), v.c3));
}
}
}

View File

@@ -0,0 +1,998 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using System.Diagnostics;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2 component vector of doubles.</summary>
[DebuggerTypeProxy(typeof(double2.DebuggerProxy))]
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double2 : System.IEquatable<double2>, IFormattable
{
/// <summary>x component of the vector.</summary>
public double x;
/// <summary>y component of the vector.</summary>
public double y;
/// <summary>double2 zero value.</summary>
public static readonly double2 zero;
/// <summary>Constructs a double2 vector from two double values.</summary>
/// <param name="x">The constructed vector's x component will be set to this value.</param>
/// <param name="y">The constructed vector's y component will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(double x, double y)
{
this.x = x;
this.y = y;
}
/// <summary>Constructs a double2 vector from a double2 vector.</summary>
/// <param name="xy">The constructed vector's xy components will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(double2 xy)
{
this.x = xy.x;
this.y = xy.y;
}
/// <summary>Constructs a double2 vector from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(double v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a double2 vector from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(bool v)
{
this.x = v ? 1.0 : 0.0;
this.y = v ? 1.0 : 0.0;
}
/// <summary>Constructs a double2 vector from a bool2 vector by componentwise conversion.</summary>
/// <param name="v">bool2 to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(bool2 v)
{
this.x = v.x ? 1.0 : 0.0;
this.y = v.y ? 1.0 : 0.0;
}
/// <summary>Constructs a double2 vector from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(int v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a double2 vector from a int2 vector by componentwise conversion.</summary>
/// <param name="v">int2 to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(int2 v)
{
this.x = v.x;
this.y = v.y;
}
/// <summary>Constructs a double2 vector from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(uint v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a double2 vector from a uint2 vector by componentwise conversion.</summary>
/// <param name="v">uint2 to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(uint2 v)
{
this.x = v.x;
this.y = v.y;
}
/// <summary>Constructs a double2 vector from a single half value by converting it to double and assigning it to every component.</summary>
/// <param name="v">half to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(half v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a double2 vector from a half2 vector by componentwise conversion.</summary>
/// <param name="v">half2 to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(half2 v)
{
this.x = v.x;
this.y = v.y;
}
/// <summary>Constructs a double2 vector from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(float v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a double2 vector from a float2 vector by componentwise conversion.</summary>
/// <param name="v">float2 to convert to double2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2(float2 v)
{
this.x = v.x;
this.y = v.y;
}
/// <summary>Implicitly converts a single double value to a double2 vector by assigning it to every component.</summary>
/// <param name="v">double to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2(double v) { return new double2(v); }
/// <summary>Explicitly converts a single bool value to a double2 vector by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double2(bool v) { return new double2(v); }
/// <summary>Explicitly converts a bool2 vector to a double2 vector by componentwise conversion.</summary>
/// <param name="v">bool2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double2(bool2 v) { return new double2(v); }
/// <summary>Implicitly converts a single int value to a double2 vector by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2(int v) { return new double2(v); }
/// <summary>Implicitly converts a int2 vector to a double2 vector by componentwise conversion.</summary>
/// <param name="v">int2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2(int2 v) { return new double2(v); }
/// <summary>Implicitly converts a single uint value to a double2 vector by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2(uint v) { return new double2(v); }
/// <summary>Implicitly converts a uint2 vector to a double2 vector by componentwise conversion.</summary>
/// <param name="v">uint2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2(uint2 v) { return new double2(v); }
/// <summary>Implicitly converts a single half value to a double2 vector by converting it to double and assigning it to every component.</summary>
/// <param name="v">half to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2(half v) { return new double2(v); }
/// <summary>Implicitly converts a half2 vector to a double2 vector by componentwise conversion.</summary>
/// <param name="v">half2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2(half2 v) { return new double2(v); }
/// <summary>Implicitly converts a single float value to a double2 vector by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2(float v) { return new double2(v); }
/// <summary>Implicitly converts a float2 vector to a double2 vector by componentwise conversion.</summary>
/// <param name="v">float2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2(float2 v) { return new double2(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise multiplication.</param>
/// <returns>double2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator * (double2 lhs, double2 rhs) { return new double2 (lhs.x * rhs.x, lhs.y * rhs.y); }
/// <summary>Returns the result of a componentwise multiplication operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator * (double2 lhs, double rhs) { return new double2 (lhs.x * rhs, lhs.y * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise multiplication.</param>
/// <returns>double2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator * (double lhs, double2 rhs) { return new double2 (lhs * rhs.x, lhs * rhs.y); }
/// <summary>Returns the result of a componentwise addition operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise addition.</param>
/// <returns>double2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator + (double2 lhs, double2 rhs) { return new double2 (lhs.x + rhs.x, lhs.y + rhs.y); }
/// <summary>Returns the result of a componentwise addition operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator + (double2 lhs, double rhs) { return new double2 (lhs.x + rhs, lhs.y + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise addition.</param>
/// <returns>double2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator + (double lhs, double2 rhs) { return new double2 (lhs + rhs.x, lhs + rhs.y); }
/// <summary>Returns the result of a componentwise subtraction operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise subtraction.</param>
/// <returns>double2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator - (double2 lhs, double2 rhs) { return new double2 (lhs.x - rhs.x, lhs.y - rhs.y); }
/// <summary>Returns the result of a componentwise subtraction operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator - (double2 lhs, double rhs) { return new double2 (lhs.x - rhs, lhs.y - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise subtraction.</param>
/// <returns>double2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator - (double lhs, double2 rhs) { return new double2 (lhs - rhs.x, lhs - rhs.y); }
/// <summary>Returns the result of a componentwise division operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise division.</param>
/// <returns>double2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator / (double2 lhs, double2 rhs) { return new double2 (lhs.x / rhs.x, lhs.y / rhs.y); }
/// <summary>Returns the result of a componentwise division operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator / (double2 lhs, double rhs) { return new double2 (lhs.x / rhs, lhs.y / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise division.</param>
/// <returns>double2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator / (double lhs, double2 rhs) { return new double2 (lhs / rhs.x, lhs / rhs.y); }
/// <summary>Returns the result of a componentwise modulus operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise modulus.</param>
/// <returns>double2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator % (double2 lhs, double2 rhs) { return new double2 (lhs.x % rhs.x, lhs.y % rhs.y); }
/// <summary>Returns the result of a componentwise modulus operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator % (double2 lhs, double rhs) { return new double2 (lhs.x % rhs, lhs.y % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise modulus.</param>
/// <returns>double2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator % (double lhs, double2 rhs) { return new double2 (lhs % rhs.x, lhs % rhs.y); }
/// <summary>Returns the result of a componentwise increment operation on a double2 vector.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double2 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator ++ (double2 val) { return new double2 (++val.x, ++val.y); }
/// <summary>Returns the result of a componentwise decrement operation on a double2 vector.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double2 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator -- (double2 val) { return new double2 (--val.x, --val.y); }
/// <summary>Returns the result of a componentwise less than operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise less than.</param>
/// <returns>bool2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator < (double2 lhs, double2 rhs) { return new bool2 (lhs.x < rhs.x, lhs.y < rhs.y); }
/// <summary>Returns the result of a componentwise less than operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator < (double2 lhs, double rhs) { return new bool2 (lhs.x < rhs, lhs.y < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise less than.</param>
/// <returns>bool2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator < (double lhs, double2 rhs) { return new bool2 (lhs < rhs.x, lhs < rhs.y); }
/// <summary>Returns the result of a componentwise less or equal operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise less or equal.</param>
/// <returns>bool2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator <= (double2 lhs, double2 rhs) { return new bool2 (lhs.x <= rhs.x, lhs.y <= rhs.y); }
/// <summary>Returns the result of a componentwise less or equal operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator <= (double2 lhs, double rhs) { return new bool2 (lhs.x <= rhs, lhs.y <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise less or equal.</param>
/// <returns>bool2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator <= (double lhs, double2 rhs) { return new bool2 (lhs <= rhs.x, lhs <= rhs.y); }
/// <summary>Returns the result of a componentwise greater than operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise greater than.</param>
/// <returns>bool2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator > (double2 lhs, double2 rhs) { return new bool2 (lhs.x > rhs.x, lhs.y > rhs.y); }
/// <summary>Returns the result of a componentwise greater than operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator > (double2 lhs, double rhs) { return new bool2 (lhs.x > rhs, lhs.y > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise greater than.</param>
/// <returns>bool2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator > (double lhs, double2 rhs) { return new bool2 (lhs > rhs.x, lhs > rhs.y); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator >= (double2 lhs, double2 rhs) { return new bool2 (lhs.x >= rhs.x, lhs.y >= rhs.y); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator >= (double2 lhs, double rhs) { return new bool2 (lhs.x >= rhs, lhs.y >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator >= (double lhs, double2 rhs) { return new bool2 (lhs >= rhs.x, lhs >= rhs.y); }
/// <summary>Returns the result of a componentwise unary minus operation on a double2 vector.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double2 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator - (double2 val) { return new double2 (-val.x, -val.y); }
/// <summary>Returns the result of a componentwise unary plus operation on a double2 vector.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double2 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 operator + (double2 val) { return new double2 (+val.x, +val.y); }
/// <summary>Returns the result of a componentwise equality operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (double2 lhs, double2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); }
/// <summary>Returns the result of a componentwise equality operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (double2 lhs, double rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (double lhs, double2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); }
/// <summary>Returns the result of a componentwise not equal operation on two double2 vectors.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (double2 lhs, double2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); }
/// <summary>Returns the result of a componentwise not equal operation on a double2 vector and a double value.</summary>
/// <param name="lhs">Left hand side double2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (double2 lhs, double rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double2 vector.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double2 to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (double lhs, double2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); }
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 xxxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(x, x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 xxxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(x, x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 xxyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(x, x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 xxyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(x, x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 xyxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(x, y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 xyxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(x, y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 xyyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(x, y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 xyyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(x, y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 yxxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(y, x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 yxxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(y, x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 yxyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(y, x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 yxyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(y, x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 yyxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(y, y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 yyxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(y, y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 yyyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(y, y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double4 yyyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double4(y, y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double3 xxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double3(x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double3 xxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double3(x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double3 xyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double3(x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double3 xyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double3(x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double3 yxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double3(y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double3 yxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double3(y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double3 yyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double3(y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double3 yyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double3(y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double2 xx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double2(x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double2 xy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double2(x, y); }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
set { x = value.x; y = value.y; }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double2 yx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double2(y, x); }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
set { y = value.x; x = value.y; }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public double2 yy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new double2(y, y); }
}
/// <summary>Returns the double element at a specified index.</summary>
unsafe public double this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (double2* array = &this) { return ((double*)array)[index]; }
}
set
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (double* array = &x) { array[index] = value; }
}
}
/// <summary>Returns true if the double2 is equal to a given double2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double2 rhs) { return x == rhs.x && y == rhs.y; }
/// <summary>Returns true if the double2 is equal to a given double2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double2 converted && Equals(converted); }
/// <summary>Returns a hash code for the double2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double2({0}, {1})", x, y);
}
/// <summary>Returns a string representation of the double2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double2({0}, {1})", x.ToString(format, formatProvider), y.ToString(format, formatProvider));
}
internal sealed class DebuggerProxy
{
public double x;
public double y;
public DebuggerProxy(double2 v)
{
x = v.x;
y = v.y;
}
}
}
public static partial class math
{
/// <summary>Returns a double2 vector constructed from two double values.</summary>
/// <param name="x">The constructed vector's x component will be set to this value.</param>
/// <param name="y">The constructed vector's y component will be set to this value.</param>
/// <returns>double2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(double x, double y) { return new double2(x, y); }
/// <summary>Returns a double2 vector constructed from a double2 vector.</summary>
/// <param name="xy">The constructed vector's xy components will be set to this value.</param>
/// <returns>double2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(double2 xy) { return new double2(xy); }
/// <summary>Returns a double2 vector constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(double v) { return new double2(v); }
/// <summary>Returns a double2 vector constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(bool v) { return new double2(v); }
/// <summary>Return a double2 vector constructed from a bool2 vector by componentwise conversion.</summary>
/// <param name="v">bool2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(bool2 v) { return new double2(v); }
/// <summary>Returns a double2 vector constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(int v) { return new double2(v); }
/// <summary>Return a double2 vector constructed from a int2 vector by componentwise conversion.</summary>
/// <param name="v">int2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(int2 v) { return new double2(v); }
/// <summary>Returns a double2 vector constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(uint v) { return new double2(v); }
/// <summary>Return a double2 vector constructed from a uint2 vector by componentwise conversion.</summary>
/// <param name="v">uint2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(uint2 v) { return new double2(v); }
/// <summary>Returns a double2 vector constructed from a single half value by converting it to double and assigning it to every component.</summary>
/// <param name="v">half to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(half v) { return new double2(v); }
/// <summary>Return a double2 vector constructed from a half2 vector by componentwise conversion.</summary>
/// <param name="v">half2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(half2 v) { return new double2(v); }
/// <summary>Returns a double2 vector constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(float v) { return new double2(v); }
/// <summary>Return a double2 vector constructed from a float2 vector by componentwise conversion.</summary>
/// <param name="v">float2 to convert to double2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 double2(float2 v) { return new double2(v); }
/// <summary>Returns a uint hash code of a double2 vector.</summary>
/// <param name="v">Vector value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double2 v)
{
return csum(fold_to_uint(v) * uint2(0x9536A0F5u, 0xAF816615u)) + 0x9AF8D62Du;
}
/// <summary>
/// Returns a uint2 vector hash code of a double2 vector.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Vector value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(double2 v)
{
return (fold_to_uint(v) * uint2(0xE3600729u, 0x5F17300Du)) + 0x670D6809u;
}
/// <summary>Returns the result of specified shuffling of the components from two double2 vectors into a double value.</summary>
/// <param name="left">double2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">double2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting double.</param>
/// <returns>double result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double shuffle(double2 left, double2 right, ShuffleComponent x)
{
return select_shuffle_component(left, right, x);
}
/// <summary>Returns the result of specified shuffling of the components from two double2 vectors into a double2 vector.</summary>
/// <param name="left">double2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">double2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting double2 x component.</param>
/// <param name="y">The ShuffleComponent to use when setting the resulting double2 y component.</param>
/// <returns>double2 result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 shuffle(double2 left, double2 right, ShuffleComponent x, ShuffleComponent y)
{
return double2(
select_shuffle_component(left, right, x),
select_shuffle_component(left, right, y));
}
/// <summary>Returns the result of specified shuffling of the components from two double2 vectors into a double3 vector.</summary>
/// <param name="left">double2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">double2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting double3 x component.</param>
/// <param name="y">The ShuffleComponent to use when setting the resulting double3 y component.</param>
/// <param name="z">The ShuffleComponent to use when setting the resulting double3 z component.</param>
/// <returns>double3 result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3 shuffle(double2 left, double2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
{
return double3(
select_shuffle_component(left, right, x),
select_shuffle_component(left, right, y),
select_shuffle_component(left, right, z));
}
/// <summary>Returns the result of specified shuffling of the components from two double2 vectors into a double4 vector.</summary>
/// <param name="left">double2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">double2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting double4 x component.</param>
/// <param name="y">The ShuffleComponent to use when setting the resulting double4 y component.</param>
/// <param name="z">The ShuffleComponent to use when setting the resulting double4 z component.</param>
/// <param name="w">The ShuffleComponent to use when setting the resulting double4 w component.</param>
/// <returns>double4 result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4 shuffle(double2 left, double2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
{
return double4(
select_shuffle_component(left, right, x),
select_shuffle_component(left, right, y),
select_shuffle_component(left, right, z),
select_shuffle_component(left, right, w));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static double select_shuffle_component(double2 a, double2 b, ShuffleComponent component)
{
switch(component)
{
case ShuffleComponent.LeftX:
return a.x;
case ShuffleComponent.LeftY:
return a.y;
case ShuffleComponent.RightX:
return b.x;
case ShuffleComponent.RightY:
return b.y;
default:
throw new System.ArgumentException("Invalid shuffle component: " + component);
}
}
}
}

View File

@@ -0,0 +1,658 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x2 matrix of doubles.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double2x2 : System.IEquatable<double2x2>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public double2 c0;
/// <summary>Column 1 of the matrix.</summary>
public double2 c1;
/// <summary>double2x2 identity transform.</summary>
public static readonly double2x2 identity = new double2x2(1.0, 0.0, 0.0, 1.0);
/// <summary>double2x2 zero value.</summary>
public static readonly double2x2 zero;
/// <summary>Constructs a double2x2 matrix from two double2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(double2 c0, double2 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a double2x2 matrix from 4 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(double m00, double m01,
double m10, double m11)
{
this.c0 = new double2(m00, m10);
this.c1 = new double2(m01, m11);
}
/// <summary>Constructs a double2x2 matrix from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(double v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double2x2 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(bool v)
{
this.c0 = math.select(new double2(0.0), new double2(1.0), v);
this.c1 = math.select(new double2(0.0), new double2(1.0), v);
}
/// <summary>Constructs a double2x2 matrix from a bool2x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x2 to convert to double2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(bool2x2 v)
{
this.c0 = math.select(new double2(0.0), new double2(1.0), v.c0);
this.c1 = math.select(new double2(0.0), new double2(1.0), v.c1);
}
/// <summary>Constructs a double2x2 matrix from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(int v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double2x2 matrix from a int2x2 matrix by componentwise conversion.</summary>
/// <param name="v">int2x2 to convert to double2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(int2x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a double2x2 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(uint v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double2x2 matrix from a uint2x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x2 to convert to double2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(uint2x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a double2x2 matrix from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(float v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double2x2 matrix from a float2x2 matrix by componentwise conversion.</summary>
/// <param name="v">float2x2 to convert to double2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x2(float2x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Implicitly converts a single double value to a double2x2 matrix by assigning it to every component.</summary>
/// <param name="v">double to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x2(double v) { return new double2x2(v); }
/// <summary>Explicitly converts a single bool value to a double2x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double2x2(bool v) { return new double2x2(v); }
/// <summary>Explicitly converts a bool2x2 matrix to a double2x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x2 to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double2x2(bool2x2 v) { return new double2x2(v); }
/// <summary>Implicitly converts a single int value to a double2x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x2(int v) { return new double2x2(v); }
/// <summary>Implicitly converts a int2x2 matrix to a double2x2 matrix by componentwise conversion.</summary>
/// <param name="v">int2x2 to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x2(int2x2 v) { return new double2x2(v); }
/// <summary>Implicitly converts a single uint value to a double2x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x2(uint v) { return new double2x2(v); }
/// <summary>Implicitly converts a uint2x2 matrix to a double2x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x2 to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x2(uint2x2 v) { return new double2x2(v); }
/// <summary>Implicitly converts a single float value to a double2x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x2(float v) { return new double2x2(v); }
/// <summary>Implicitly converts a float2x2 matrix to a double2x2 matrix by componentwise conversion.</summary>
/// <param name="v">float2x2 to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x2(float2x2 v) { return new double2x2(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise multiplication.</param>
/// <returns>double2x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator * (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
/// <summary>Returns the result of a componentwise multiplication operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double2x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator * (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise multiplication.</param>
/// <returns>double2x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator * (double lhs, double2x2 rhs) { return new double2x2 (lhs * rhs.c0, lhs * rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise addition.</param>
/// <returns>double2x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator + (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double2x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator + (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise addition.</param>
/// <returns>double2x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator + (double lhs, double2x2 rhs) { return new double2x2 (lhs + rhs.c0, lhs + rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise subtraction.</param>
/// <returns>double2x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator - (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double2x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator - (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise subtraction.</param>
/// <returns>double2x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator - (double lhs, double2x2 rhs) { return new double2x2 (lhs - rhs.c0, lhs - rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise division.</param>
/// <returns>double2x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator / (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double2x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator / (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise division.</param>
/// <returns>double2x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator / (double lhs, double2x2 rhs) { return new double2x2 (lhs / rhs.c0, lhs / rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise modulus.</param>
/// <returns>double2x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator % (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double2x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator % (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise modulus.</param>
/// <returns>double2x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator % (double lhs, double2x2 rhs) { return new double2x2 (lhs % rhs.c0, lhs % rhs.c1); }
/// <summary>Returns the result of a componentwise increment operation on a double2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double2x2 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator ++ (double2x2 val) { return new double2x2 (++val.c0, ++val.c1); }
/// <summary>Returns the result of a componentwise decrement operation on a double2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double2x2 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator -- (double2x2 val) { return new double2x2 (--val.c0, --val.c1); }
/// <summary>Returns the result of a componentwise less than operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise less than.</param>
/// <returns>bool2x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator < (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
/// <summary>Returns the result of a componentwise less than operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool2x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator < (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise less than.</param>
/// <returns>bool2x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator < (double lhs, double2x2 rhs) { return new bool2x2 (lhs < rhs.c0, lhs < rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise less or equal.</param>
/// <returns>bool2x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator <= (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool2x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator <= (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise less or equal.</param>
/// <returns>bool2x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator <= (double lhs, double2x2 rhs) { return new bool2x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise greater than.</param>
/// <returns>bool2x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator > (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool2x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator > (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise greater than.</param>
/// <returns>bool2x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator > (double lhs, double2x2 rhs) { return new bool2x2 (lhs > rhs.c0, lhs > rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator >= (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool2x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator >= (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator >= (double lhs, double2x2 rhs) { return new bool2x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
/// <summary>Returns the result of a componentwise unary minus operation on a double2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double2x2 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator - (double2x2 val) { return new double2x2 (-val.c0, -val.c1); }
/// <summary>Returns the result of a componentwise unary plus operation on a double2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double2x2 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 operator + (double2x2 val) { return new double2x2 (+val.c0, +val.c1); }
/// <summary>Returns the result of a componentwise equality operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (double lhs, double2x2 rhs) { return new bool2x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two double2x2 matrices.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on a double2x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double2x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double2x2 to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (double lhs, double2x2 rhs) { return new bool2x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the double2 element at a specified index.</summary>
unsafe public ref double2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (double2x2* array = &this) { return ref ((double2*)array)[index]; }
}
}
/// <summary>Returns true if the double2x2 is equal to a given double2x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double2x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the double2x2 is equal to a given double2x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double2x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the double2x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double2x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double2x2({0}, {1}, {2}, {3})", c0.x, c1.x, c0.y, c1.y);
}
/// <summary>Returns a string representation of the double2x2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double2x2({0}, {1}, {2}, {3})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a double2x2 matrix constructed from two double2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>double2x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(double2 c0, double2 c1) { return new double2x2(c0, c1); }
/// <summary>Returns a double2x2 matrix constructed from from 4 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <returns>double2x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(double m00, double m01,
double m10, double m11)
{
return new double2x2(m00, m01,
m10, m11);
}
/// <summary>Returns a double2x2 matrix constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(double v) { return new double2x2(v); }
/// <summary>Returns a double2x2 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(bool v) { return new double2x2(v); }
/// <summary>Return a double2x2 matrix constructed from a bool2x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x2 to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(bool2x2 v) { return new double2x2(v); }
/// <summary>Returns a double2x2 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(int v) { return new double2x2(v); }
/// <summary>Return a double2x2 matrix constructed from a int2x2 matrix by componentwise conversion.</summary>
/// <param name="v">int2x2 to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(int2x2 v) { return new double2x2(v); }
/// <summary>Returns a double2x2 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(uint v) { return new double2x2(v); }
/// <summary>Return a double2x2 matrix constructed from a uint2x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x2 to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(uint2x2 v) { return new double2x2(v); }
/// <summary>Returns a double2x2 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(float v) { return new double2x2(v); }
/// <summary>Return a double2x2 matrix constructed from a float2x2 matrix by componentwise conversion.</summary>
/// <param name="v">float2x2 to convert to double2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 double2x2(float2x2 v) { return new double2x2(v); }
/// <summary>Return the double2x2 transpose of a double2x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 transpose(double2x2 v)
{
return double2x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y);
}
/// <summary>Returns the double2x2 full inverse of a double2x2 matrix.</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x2 inverse(double2x2 m)
{
double a = m.c0.x;
double b = m.c1.x;
double c = m.c0.y;
double d = m.c1.y;
double det = a * d - b * c;
return double2x2(d, -b, -c, a) * (1.0 / det);
}
/// <summary>Returns the determinant of a double2x2 matrix.</summary>
/// <param name="m">Matrix to use when computing determinant.</param>
/// <returns>The determinant of the matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double determinant(double2x2 m)
{
double a = m.c0.x;
double b = m.c1.x;
double c = m.c0.y;
double d = m.c1.y;
return a * d - b * c;
}
/// <summary>Returns a uint hash code of a double2x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double2x2 v)
{
return csum(fold_to_uint(v.c0) * uint2(0xFD80290Bu, 0x8B65ADB7u) +
fold_to_uint(v.c1) * uint2(0xDFF4F563u, 0x7069770Du)) + 0xD1224537u;
}
/// <summary>
/// Returns a uint2 vector hash code of a double2x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(double2x2 v)
{
return (fold_to_uint(v.c0) * uint2(0xE99ED6F3u, 0x48125549u) +
fold_to_uint(v.c1) * uint2(0xEEE2123Bu, 0xE3AD9FE5u)) + 0xCE1CF8BFu;
}
}
}

View File

@@ -0,0 +1,647 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x3 matrix of doubles.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double2x3 : System.IEquatable<double2x3>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public double2 c0;
/// <summary>Column 1 of the matrix.</summary>
public double2 c1;
/// <summary>Column 2 of the matrix.</summary>
public double2 c2;
/// <summary>double2x3 zero value.</summary>
public static readonly double2x3 zero;
/// <summary>Constructs a double2x3 matrix from three double2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(double2 c0, double2 c1, double2 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a double2x3 matrix from 6 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(double m00, double m01, double m02,
double m10, double m11, double m12)
{
this.c0 = new double2(m00, m10);
this.c1 = new double2(m01, m11);
this.c2 = new double2(m02, m12);
}
/// <summary>Constructs a double2x3 matrix from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(double v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double2x3 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(bool v)
{
this.c0 = math.select(new double2(0.0), new double2(1.0), v);
this.c1 = math.select(new double2(0.0), new double2(1.0), v);
this.c2 = math.select(new double2(0.0), new double2(1.0), v);
}
/// <summary>Constructs a double2x3 matrix from a bool2x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x3 to convert to double2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(bool2x3 v)
{
this.c0 = math.select(new double2(0.0), new double2(1.0), v.c0);
this.c1 = math.select(new double2(0.0), new double2(1.0), v.c1);
this.c2 = math.select(new double2(0.0), new double2(1.0), v.c2);
}
/// <summary>Constructs a double2x3 matrix from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double2x3 matrix from a int2x3 matrix by componentwise conversion.</summary>
/// <param name="v">int2x3 to convert to double2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(int2x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a double2x3 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double2x3 matrix from a uint2x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x3 to convert to double2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(uint2x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a double2x3 matrix from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double2x3 matrix from a float2x3 matrix by componentwise conversion.</summary>
/// <param name="v">float2x3 to convert to double2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x3(float2x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Implicitly converts a single double value to a double2x3 matrix by assigning it to every component.</summary>
/// <param name="v">double to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x3(double v) { return new double2x3(v); }
/// <summary>Explicitly converts a single bool value to a double2x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double2x3(bool v) { return new double2x3(v); }
/// <summary>Explicitly converts a bool2x3 matrix to a double2x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x3 to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double2x3(bool2x3 v) { return new double2x3(v); }
/// <summary>Implicitly converts a single int value to a double2x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x3(int v) { return new double2x3(v); }
/// <summary>Implicitly converts a int2x3 matrix to a double2x3 matrix by componentwise conversion.</summary>
/// <param name="v">int2x3 to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x3(int2x3 v) { return new double2x3(v); }
/// <summary>Implicitly converts a single uint value to a double2x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x3(uint v) { return new double2x3(v); }
/// <summary>Implicitly converts a uint2x3 matrix to a double2x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x3 to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x3(uint2x3 v) { return new double2x3(v); }
/// <summary>Implicitly converts a single float value to a double2x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x3(float v) { return new double2x3(v); }
/// <summary>Implicitly converts a float2x3 matrix to a double2x3 matrix by componentwise conversion.</summary>
/// <param name="v">float2x3 to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x3(float2x3 v) { return new double2x3(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise multiplication.</param>
/// <returns>double2x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator * (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); }
/// <summary>Returns the result of a componentwise multiplication operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double2x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator * (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise multiplication.</param>
/// <returns>double2x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator * (double lhs, double2x3 rhs) { return new double2x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise addition.</param>
/// <returns>double2x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator + (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double2x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator + (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise addition.</param>
/// <returns>double2x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator + (double lhs, double2x3 rhs) { return new double2x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise subtraction.</param>
/// <returns>double2x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator - (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double2x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator - (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise subtraction.</param>
/// <returns>double2x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator - (double lhs, double2x3 rhs) { return new double2x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise division.</param>
/// <returns>double2x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator / (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double2x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator / (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise division.</param>
/// <returns>double2x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator / (double lhs, double2x3 rhs) { return new double2x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise modulus.</param>
/// <returns>double2x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator % (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double2x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator % (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise modulus.</param>
/// <returns>double2x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator % (double lhs, double2x3 rhs) { return new double2x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); }
/// <summary>Returns the result of a componentwise increment operation on a double2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double2x3 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator ++ (double2x3 val) { return new double2x3 (++val.c0, ++val.c1, ++val.c2); }
/// <summary>Returns the result of a componentwise decrement operation on a double2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double2x3 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator -- (double2x3 val) { return new double2x3 (--val.c0, --val.c1, --val.c2); }
/// <summary>Returns the result of a componentwise less than operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise less than.</param>
/// <returns>bool2x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator < (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); }
/// <summary>Returns the result of a componentwise less than operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool2x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator < (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise less than.</param>
/// <returns>bool2x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator < (double lhs, double2x3 rhs) { return new bool2x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise less or equal.</param>
/// <returns>bool2x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator <= (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool2x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator <= (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise less or equal.</param>
/// <returns>bool2x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator <= (double lhs, double2x3 rhs) { return new bool2x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise greater than.</param>
/// <returns>bool2x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator > (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool2x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator > (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise greater than.</param>
/// <returns>bool2x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator > (double lhs, double2x3 rhs) { return new bool2x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator >= (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool2x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator >= (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator >= (double lhs, double2x3 rhs) { return new bool2x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); }
/// <summary>Returns the result of a componentwise unary minus operation on a double2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double2x3 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator - (double2x3 val) { return new double2x3 (-val.c0, -val.c1, -val.c2); }
/// <summary>Returns the result of a componentwise unary plus operation on a double2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double2x3 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 operator + (double2x3 val) { return new double2x3 (+val.c0, +val.c1, +val.c2); }
/// <summary>Returns the result of a componentwise equality operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (double lhs, double2x3 rhs) { return new bool2x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two double2x3 matrices.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on a double2x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double2x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double2x3 to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (double lhs, double2x3 rhs) { return new bool2x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the double2 element at a specified index.</summary>
unsafe public ref double2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (double2x3* array = &this) { return ref ((double2*)array)[index]; }
}
}
/// <summary>Returns true if the double2x3 is equal to a given double2x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double2x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the double2x3 is equal to a given double2x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double2x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the double2x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double2x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y);
}
/// <summary>Returns a string representation of the double2x3 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a double2x3 matrix constructed from three double2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>double2x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(double2 c0, double2 c1, double2 c2) { return new double2x3(c0, c1, c2); }
/// <summary>Returns a double2x3 matrix constructed from from 6 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <returns>double2x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(double m00, double m01, double m02,
double m10, double m11, double m12)
{
return new double2x3(m00, m01, m02,
m10, m11, m12);
}
/// <summary>Returns a double2x3 matrix constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(double v) { return new double2x3(v); }
/// <summary>Returns a double2x3 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(bool v) { return new double2x3(v); }
/// <summary>Return a double2x3 matrix constructed from a bool2x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x3 to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(bool2x3 v) { return new double2x3(v); }
/// <summary>Returns a double2x3 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(int v) { return new double2x3(v); }
/// <summary>Return a double2x3 matrix constructed from a int2x3 matrix by componentwise conversion.</summary>
/// <param name="v">int2x3 to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(int2x3 v) { return new double2x3(v); }
/// <summary>Returns a double2x3 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(uint v) { return new double2x3(v); }
/// <summary>Return a double2x3 matrix constructed from a uint2x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x3 to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(uint2x3 v) { return new double2x3(v); }
/// <summary>Returns a double2x3 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(float v) { return new double2x3(v); }
/// <summary>Return a double2x3 matrix constructed from a float2x3 matrix by componentwise conversion.</summary>
/// <param name="v">float2x3 to convert to double2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 double2x3(float2x3 v) { return new double2x3(v); }
/// <summary>Return the double3x2 transpose of a double2x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 transpose(double2x3 v)
{
return double3x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y,
v.c2.x, v.c2.y);
}
/// <summary>Returns a uint hash code of a double2x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double2x3 v)
{
return csum(fold_to_uint(v.c0) * uint2(0xF25BE857u, 0x9BC17CE7u) +
fold_to_uint(v.c1) * uint2(0xC8B86851u, 0x64095221u) +
fold_to_uint(v.c2) * uint2(0xADF428FFu, 0xA3977109u)) + 0x745ED837u;
}
/// <summary>
/// Returns a uint2 vector hash code of a double2x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(double2x3 v)
{
return (fold_to_uint(v.c0) * uint2(0x9CDC88F5u, 0xFA62D721u) +
fold_to_uint(v.c1) * uint2(0x7E4DB1CFu, 0x68EEE0F5u) +
fold_to_uint(v.c2) * uint2(0xBC3B0A59u, 0x816EFB5Du)) + 0xA24E82B7u;
}
}
}

View File

@@ -0,0 +1,669 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x4 matrix of doubles.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double2x4 : System.IEquatable<double2x4>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public double2 c0;
/// <summary>Column 1 of the matrix.</summary>
public double2 c1;
/// <summary>Column 2 of the matrix.</summary>
public double2 c2;
/// <summary>Column 3 of the matrix.</summary>
public double2 c3;
/// <summary>double2x4 zero value.</summary>
public static readonly double2x4 zero;
/// <summary>Constructs a double2x4 matrix from four double2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(double2 c0, double2 c1, double2 c2, double2 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a double2x4 matrix from 8 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(double m00, double m01, double m02, double m03,
double m10, double m11, double m12, double m13)
{
this.c0 = new double2(m00, m10);
this.c1 = new double2(m01, m11);
this.c2 = new double2(m02, m12);
this.c3 = new double2(m03, m13);
}
/// <summary>Constructs a double2x4 matrix from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(double v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double2x4 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(bool v)
{
this.c0 = math.select(new double2(0.0), new double2(1.0), v);
this.c1 = math.select(new double2(0.0), new double2(1.0), v);
this.c2 = math.select(new double2(0.0), new double2(1.0), v);
this.c3 = math.select(new double2(0.0), new double2(1.0), v);
}
/// <summary>Constructs a double2x4 matrix from a bool2x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x4 to convert to double2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(bool2x4 v)
{
this.c0 = math.select(new double2(0.0), new double2(1.0), v.c0);
this.c1 = math.select(new double2(0.0), new double2(1.0), v.c1);
this.c2 = math.select(new double2(0.0), new double2(1.0), v.c2);
this.c3 = math.select(new double2(0.0), new double2(1.0), v.c3);
}
/// <summary>Constructs a double2x4 matrix from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double2x4 matrix from a int2x4 matrix by componentwise conversion.</summary>
/// <param name="v">int2x4 to convert to double2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(int2x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a double2x4 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double2x4 matrix from a uint2x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x4 to convert to double2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(uint2x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a double2x4 matrix from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double2x4 matrix from a float2x4 matrix by componentwise conversion.</summary>
/// <param name="v">float2x4 to convert to double2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double2x4(float2x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Implicitly converts a single double value to a double2x4 matrix by assigning it to every component.</summary>
/// <param name="v">double to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x4(double v) { return new double2x4(v); }
/// <summary>Explicitly converts a single bool value to a double2x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double2x4(bool v) { return new double2x4(v); }
/// <summary>Explicitly converts a bool2x4 matrix to a double2x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x4 to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double2x4(bool2x4 v) { return new double2x4(v); }
/// <summary>Implicitly converts a single int value to a double2x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x4(int v) { return new double2x4(v); }
/// <summary>Implicitly converts a int2x4 matrix to a double2x4 matrix by componentwise conversion.</summary>
/// <param name="v">int2x4 to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x4(int2x4 v) { return new double2x4(v); }
/// <summary>Implicitly converts a single uint value to a double2x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x4(uint v) { return new double2x4(v); }
/// <summary>Implicitly converts a uint2x4 matrix to a double2x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x4 to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x4(uint2x4 v) { return new double2x4(v); }
/// <summary>Implicitly converts a single float value to a double2x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x4(float v) { return new double2x4(v); }
/// <summary>Implicitly converts a float2x4 matrix to a double2x4 matrix by componentwise conversion.</summary>
/// <param name="v">float2x4 to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double2x4(float2x4 v) { return new double2x4(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise multiplication.</param>
/// <returns>double2x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator * (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
/// <summary>Returns the result of a componentwise multiplication operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double2x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator * (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise multiplication.</param>
/// <returns>double2x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator * (double lhs, double2x4 rhs) { return new double2x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise addition.</param>
/// <returns>double2x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator + (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double2x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator + (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise addition.</param>
/// <returns>double2x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator + (double lhs, double2x4 rhs) { return new double2x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise subtraction.</param>
/// <returns>double2x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator - (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double2x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator - (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise subtraction.</param>
/// <returns>double2x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator - (double lhs, double2x4 rhs) { return new double2x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise division.</param>
/// <returns>double2x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator / (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double2x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator / (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise division.</param>
/// <returns>double2x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator / (double lhs, double2x4 rhs) { return new double2x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise modulus.</param>
/// <returns>double2x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator % (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double2x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator % (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise modulus.</param>
/// <returns>double2x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator % (double lhs, double2x4 rhs) { return new double2x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
/// <summary>Returns the result of a componentwise increment operation on a double2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double2x4 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator ++ (double2x4 val) { return new double2x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
/// <summary>Returns the result of a componentwise decrement operation on a double2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double2x4 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator -- (double2x4 val) { return new double2x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
/// <summary>Returns the result of a componentwise less than operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise less than.</param>
/// <returns>bool2x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator < (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
/// <summary>Returns the result of a componentwise less than operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool2x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator < (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise less than.</param>
/// <returns>bool2x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator < (double lhs, double2x4 rhs) { return new bool2x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise less or equal.</param>
/// <returns>bool2x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator <= (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool2x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator <= (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise less or equal.</param>
/// <returns>bool2x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator <= (double lhs, double2x4 rhs) { return new bool2x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise greater than.</param>
/// <returns>bool2x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator > (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool2x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator > (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise greater than.</param>
/// <returns>bool2x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator > (double lhs, double2x4 rhs) { return new bool2x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator >= (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool2x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator >= (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator >= (double lhs, double2x4 rhs) { return new bool2x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
/// <summary>Returns the result of a componentwise unary minus operation on a double2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double2x4 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator - (double2x4 val) { return new double2x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
/// <summary>Returns the result of a componentwise unary plus operation on a double2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double2x4 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 operator + (double2x4 val) { return new double2x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
/// <summary>Returns the result of a componentwise equality operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (double lhs, double2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two double2x4 matrices.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on a double2x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double2x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double2x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double2x4 to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (double lhs, double2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the double2 element at a specified index.</summary>
unsafe public ref double2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (double2x4* array = &this) { return ref ((double2*)array)[index]; }
}
}
/// <summary>Returns true if the double2x4 is equal to a given double2x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the double2x4 is equal to a given double2x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double2x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the double2x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double2x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y);
}
/// <summary>Returns a string representation of the double2x4 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a double2x4 matrix constructed from four double2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>double2x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(double2 c0, double2 c1, double2 c2, double2 c3) { return new double2x4(c0, c1, c2, c3); }
/// <summary>Returns a double2x4 matrix constructed from from 8 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <returns>double2x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(double m00, double m01, double m02, double m03,
double m10, double m11, double m12, double m13)
{
return new double2x4(m00, m01, m02, m03,
m10, m11, m12, m13);
}
/// <summary>Returns a double2x4 matrix constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(double v) { return new double2x4(v); }
/// <summary>Returns a double2x4 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(bool v) { return new double2x4(v); }
/// <summary>Return a double2x4 matrix constructed from a bool2x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x4 to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(bool2x4 v) { return new double2x4(v); }
/// <summary>Returns a double2x4 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(int v) { return new double2x4(v); }
/// <summary>Return a double2x4 matrix constructed from a int2x4 matrix by componentwise conversion.</summary>
/// <param name="v">int2x4 to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(int2x4 v) { return new double2x4(v); }
/// <summary>Returns a double2x4 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(uint v) { return new double2x4(v); }
/// <summary>Return a double2x4 matrix constructed from a uint2x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x4 to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(uint2x4 v) { return new double2x4(v); }
/// <summary>Returns a double2x4 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(float v) { return new double2x4(v); }
/// <summary>Return a double2x4 matrix constructed from a float2x4 matrix by componentwise conversion.</summary>
/// <param name="v">float2x4 to convert to double2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 double2x4(float2x4 v) { return new double2x4(v); }
/// <summary>Return the double4x2 transpose of a double2x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 transpose(double2x4 v)
{
return double4x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y,
v.c2.x, v.c2.y,
v.c3.x, v.c3.y);
}
/// <summary>Returns a uint hash code of a double2x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double2x4 v)
{
return csum(fold_to_uint(v.c0) * uint2(0x91475DF7u, 0x55E84827u) +
fold_to_uint(v.c1) * uint2(0x90A285BBu, 0x5D19E1D5u) +
fold_to_uint(v.c2) * uint2(0xFAAF07DDu, 0x625C45BDu) +
fold_to_uint(v.c3) * uint2(0xC9F27FCBu, 0x6D2523B1u)) + 0x6E2BF6A9u;
}
/// <summary>
/// Returns a uint2 vector hash code of a double2x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(double2x4 v)
{
return (fold_to_uint(v.c0) * uint2(0xCC74B3B7u, 0x83B58237u) +
fold_to_uint(v.c1) * uint2(0x833E3E29u, 0xA9D919BFu) +
fold_to_uint(v.c2) * uint2(0xC3EC1D97u, 0xB8B208C7u) +
fold_to_uint(v.c3) * uint2(0x5D3ED947u, 0x4473BBB1u)) + 0xCBA11D5Fu;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,632 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 3x2 matrix of doubles.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double3x2 : System.IEquatable<double3x2>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public double3 c0;
/// <summary>Column 1 of the matrix.</summary>
public double3 c1;
/// <summary>double3x2 zero value.</summary>
public static readonly double3x2 zero;
/// <summary>Constructs a double3x2 matrix from two double3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(double3 c0, double3 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a double3x2 matrix from 6 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(double m00, double m01,
double m10, double m11,
double m20, double m21)
{
this.c0 = new double3(m00, m10, m20);
this.c1 = new double3(m01, m11, m21);
}
/// <summary>Constructs a double3x2 matrix from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(double v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double3x2 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(bool v)
{
this.c0 = math.select(new double3(0.0), new double3(1.0), v);
this.c1 = math.select(new double3(0.0), new double3(1.0), v);
}
/// <summary>Constructs a double3x2 matrix from a bool3x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x2 to convert to double3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(bool3x2 v)
{
this.c0 = math.select(new double3(0.0), new double3(1.0), v.c0);
this.c1 = math.select(new double3(0.0), new double3(1.0), v.c1);
}
/// <summary>Constructs a double3x2 matrix from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(int v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double3x2 matrix from a int3x2 matrix by componentwise conversion.</summary>
/// <param name="v">int3x2 to convert to double3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(int3x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a double3x2 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(uint v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double3x2 matrix from a uint3x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x2 to convert to double3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(uint3x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a double3x2 matrix from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(float v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double3x2 matrix from a float3x2 matrix by componentwise conversion.</summary>
/// <param name="v">float3x2 to convert to double3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x2(float3x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Implicitly converts a single double value to a double3x2 matrix by assigning it to every component.</summary>
/// <param name="v">double to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x2(double v) { return new double3x2(v); }
/// <summary>Explicitly converts a single bool value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double3x2(bool v) { return new double3x2(v); }
/// <summary>Explicitly converts a bool3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x2 to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double3x2(bool3x2 v) { return new double3x2(v); }
/// <summary>Implicitly converts a single int value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x2(int v) { return new double3x2(v); }
/// <summary>Implicitly converts a int3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
/// <param name="v">int3x2 to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x2(int3x2 v) { return new double3x2(v); }
/// <summary>Implicitly converts a single uint value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x2(uint v) { return new double3x2(v); }
/// <summary>Implicitly converts a uint3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x2 to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x2(uint3x2 v) { return new double3x2(v); }
/// <summary>Implicitly converts a single float value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x2(float v) { return new double3x2(v); }
/// <summary>Implicitly converts a float3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
/// <param name="v">float3x2 to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x2(float3x2 v) { return new double3x2(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise multiplication.</param>
/// <returns>double3x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator * (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
/// <summary>Returns the result of a componentwise multiplication operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double3x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator * (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise multiplication.</param>
/// <returns>double3x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator * (double lhs, double3x2 rhs) { return new double3x2 (lhs * rhs.c0, lhs * rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise addition.</param>
/// <returns>double3x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator + (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double3x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator + (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise addition.</param>
/// <returns>double3x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator + (double lhs, double3x2 rhs) { return new double3x2 (lhs + rhs.c0, lhs + rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise subtraction.</param>
/// <returns>double3x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator - (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double3x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator - (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise subtraction.</param>
/// <returns>double3x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator - (double lhs, double3x2 rhs) { return new double3x2 (lhs - rhs.c0, lhs - rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise division.</param>
/// <returns>double3x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator / (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double3x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator / (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise division.</param>
/// <returns>double3x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator / (double lhs, double3x2 rhs) { return new double3x2 (lhs / rhs.c0, lhs / rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise modulus.</param>
/// <returns>double3x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator % (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double3x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator % (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise modulus.</param>
/// <returns>double3x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator % (double lhs, double3x2 rhs) { return new double3x2 (lhs % rhs.c0, lhs % rhs.c1); }
/// <summary>Returns the result of a componentwise increment operation on a double3x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double3x2 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator ++ (double3x2 val) { return new double3x2 (++val.c0, ++val.c1); }
/// <summary>Returns the result of a componentwise decrement operation on a double3x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double3x2 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator -- (double3x2 val) { return new double3x2 (--val.c0, --val.c1); }
/// <summary>Returns the result of a componentwise less than operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise less than.</param>
/// <returns>bool3x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator < (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
/// <summary>Returns the result of a componentwise less than operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool3x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator < (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise less than.</param>
/// <returns>bool3x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator < (double lhs, double3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise less or equal.</param>
/// <returns>bool3x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator <= (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool3x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator <= (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise less or equal.</param>
/// <returns>bool3x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator <= (double lhs, double3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise greater than.</param>
/// <returns>bool3x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator > (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool3x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator > (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise greater than.</param>
/// <returns>bool3x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator > (double lhs, double3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator >= (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool3x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator >= (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator >= (double lhs, double3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
/// <summary>Returns the result of a componentwise unary minus operation on a double3x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double3x2 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator - (double3x2 val) { return new double3x2 (-val.c0, -val.c1); }
/// <summary>Returns the result of a componentwise unary plus operation on a double3x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double3x2 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 operator + (double3x2 val) { return new double3x2 (+val.c0, +val.c1); }
/// <summary>Returns the result of a componentwise equality operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise equality.</param>
/// <returns>bool3x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator == (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool3x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator == (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise equality.</param>
/// <returns>bool3x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator == (double lhs, double3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two double3x2 matrices.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise not equal.</param>
/// <returns>bool3x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator != (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on a double3x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool3x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator != (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double3x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double3x2 to use to compute componentwise not equal.</param>
/// <returns>bool3x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator != (double lhs, double3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the double3 element at a specified index.</summary>
unsafe public ref double3 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (double3x2* array = &this) { return ref ((double3*)array)[index]; }
}
}
/// <summary>Returns true if the double3x2 is equal to a given double3x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the double3x2 is equal to a given double3x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double3x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the double3x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double3x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z);
}
/// <summary>Returns a string representation of the double3x2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a double3x2 matrix constructed from two double3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>double3x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(double3 c0, double3 c1) { return new double3x2(c0, c1); }
/// <summary>Returns a double3x2 matrix constructed from from 6 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <returns>double3x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(double m00, double m01,
double m10, double m11,
double m20, double m21)
{
return new double3x2(m00, m01,
m10, m11,
m20, m21);
}
/// <summary>Returns a double3x2 matrix constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(double v) { return new double3x2(v); }
/// <summary>Returns a double3x2 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(bool v) { return new double3x2(v); }
/// <summary>Return a double3x2 matrix constructed from a bool3x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x2 to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(bool3x2 v) { return new double3x2(v); }
/// <summary>Returns a double3x2 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(int v) { return new double3x2(v); }
/// <summary>Return a double3x2 matrix constructed from a int3x2 matrix by componentwise conversion.</summary>
/// <param name="v">int3x2 to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(int3x2 v) { return new double3x2(v); }
/// <summary>Returns a double3x2 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(uint v) { return new double3x2(v); }
/// <summary>Return a double3x2 matrix constructed from a uint3x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x2 to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(uint3x2 v) { return new double3x2(v); }
/// <summary>Returns a double3x2 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(float v) { return new double3x2(v); }
/// <summary>Return a double3x2 matrix constructed from a float3x2 matrix by componentwise conversion.</summary>
/// <param name="v">float3x2 to convert to double3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x2 double3x2(float3x2 v) { return new double3x2(v); }
/// <summary>Return the double2x3 transpose of a double3x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x3 transpose(double3x2 v)
{
return double2x3(
v.c0.x, v.c0.y, v.c0.z,
v.c1.x, v.c1.y, v.c1.z);
}
/// <summary>Returns a uint hash code of a double3x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double3x2 v)
{
return csum(fold_to_uint(v.c0) * uint3(0xEE390C97u, 0x9C8A2F05u, 0x4DDC6509u) +
fold_to_uint(v.c1) * uint3(0x7CF083CBu, 0x5C4D6CEDu, 0xF9137117u)) + 0xE857DCE1u;
}
/// <summary>
/// Returns a uint3 vector hash code of a double3x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint3 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint3 hashwide(double3x2 v)
{
return (fold_to_uint(v.c0) * uint3(0xF62213C5u, 0x9CDAA959u, 0xAA269ABFu) +
fold_to_uint(v.c1) * uint3(0xD54BA36Fu, 0xFD0847B9u, 0x8189A683u)) + 0xB139D651u;
}
}
}

View File

@@ -0,0 +1,697 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 3x3 matrix of doubles.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double3x3 : System.IEquatable<double3x3>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public double3 c0;
/// <summary>Column 1 of the matrix.</summary>
public double3 c1;
/// <summary>Column 2 of the matrix.</summary>
public double3 c2;
/// <summary>double3x3 identity transform.</summary>
public static readonly double3x3 identity = new double3x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
/// <summary>double3x3 zero value.</summary>
public static readonly double3x3 zero;
/// <summary>Constructs a double3x3 matrix from three double3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(double3 c0, double3 c1, double3 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a double3x3 matrix from 9 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(double m00, double m01, double m02,
double m10, double m11, double m12,
double m20, double m21, double m22)
{
this.c0 = new double3(m00, m10, m20);
this.c1 = new double3(m01, m11, m21);
this.c2 = new double3(m02, m12, m22);
}
/// <summary>Constructs a double3x3 matrix from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(double v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double3x3 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(bool v)
{
this.c0 = math.select(new double3(0.0), new double3(1.0), v);
this.c1 = math.select(new double3(0.0), new double3(1.0), v);
this.c2 = math.select(new double3(0.0), new double3(1.0), v);
}
/// <summary>Constructs a double3x3 matrix from a bool3x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x3 to convert to double3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(bool3x3 v)
{
this.c0 = math.select(new double3(0.0), new double3(1.0), v.c0);
this.c1 = math.select(new double3(0.0), new double3(1.0), v.c1);
this.c2 = math.select(new double3(0.0), new double3(1.0), v.c2);
}
/// <summary>Constructs a double3x3 matrix from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double3x3 matrix from a int3x3 matrix by componentwise conversion.</summary>
/// <param name="v">int3x3 to convert to double3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(int3x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a double3x3 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double3x3 matrix from a uint3x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x3 to convert to double3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(uint3x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a double3x3 matrix from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double3x3 matrix from a float3x3 matrix by componentwise conversion.</summary>
/// <param name="v">float3x3 to convert to double3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x3(float3x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Implicitly converts a single double value to a double3x3 matrix by assigning it to every component.</summary>
/// <param name="v">double to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x3(double v) { return new double3x3(v); }
/// <summary>Explicitly converts a single bool value to a double3x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double3x3(bool v) { return new double3x3(v); }
/// <summary>Explicitly converts a bool3x3 matrix to a double3x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x3 to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double3x3(bool3x3 v) { return new double3x3(v); }
/// <summary>Implicitly converts a single int value to a double3x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x3(int v) { return new double3x3(v); }
/// <summary>Implicitly converts a int3x3 matrix to a double3x3 matrix by componentwise conversion.</summary>
/// <param name="v">int3x3 to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x3(int3x3 v) { return new double3x3(v); }
/// <summary>Implicitly converts a single uint value to a double3x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x3(uint v) { return new double3x3(v); }
/// <summary>Implicitly converts a uint3x3 matrix to a double3x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x3 to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x3(uint3x3 v) { return new double3x3(v); }
/// <summary>Implicitly converts a single float value to a double3x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x3(float v) { return new double3x3(v); }
/// <summary>Implicitly converts a float3x3 matrix to a double3x3 matrix by componentwise conversion.</summary>
/// <param name="v">float3x3 to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x3(float3x3 v) { return new double3x3(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise multiplication.</param>
/// <returns>double3x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator * (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); }
/// <summary>Returns the result of a componentwise multiplication operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double3x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator * (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise multiplication.</param>
/// <returns>double3x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator * (double lhs, double3x3 rhs) { return new double3x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise addition.</param>
/// <returns>double3x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator + (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double3x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator + (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise addition.</param>
/// <returns>double3x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator + (double lhs, double3x3 rhs) { return new double3x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise subtraction.</param>
/// <returns>double3x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator - (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double3x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator - (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise subtraction.</param>
/// <returns>double3x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator - (double lhs, double3x3 rhs) { return new double3x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise division.</param>
/// <returns>double3x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator / (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double3x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator / (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise division.</param>
/// <returns>double3x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator / (double lhs, double3x3 rhs) { return new double3x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise modulus.</param>
/// <returns>double3x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator % (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double3x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator % (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise modulus.</param>
/// <returns>double3x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator % (double lhs, double3x3 rhs) { return new double3x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); }
/// <summary>Returns the result of a componentwise increment operation on a double3x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double3x3 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator ++ (double3x3 val) { return new double3x3 (++val.c0, ++val.c1, ++val.c2); }
/// <summary>Returns the result of a componentwise decrement operation on a double3x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double3x3 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator -- (double3x3 val) { return new double3x3 (--val.c0, --val.c1, --val.c2); }
/// <summary>Returns the result of a componentwise less than operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise less than.</param>
/// <returns>bool3x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator < (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); }
/// <summary>Returns the result of a componentwise less than operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool3x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator < (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise less than.</param>
/// <returns>bool3x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator < (double lhs, double3x3 rhs) { return new bool3x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise less or equal.</param>
/// <returns>bool3x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator <= (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool3x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator <= (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise less or equal.</param>
/// <returns>bool3x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator <= (double lhs, double3x3 rhs) { return new bool3x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise greater than.</param>
/// <returns>bool3x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator > (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool3x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator > (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise greater than.</param>
/// <returns>bool3x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator > (double lhs, double3x3 rhs) { return new bool3x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator >= (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool3x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator >= (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator >= (double lhs, double3x3 rhs) { return new bool3x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); }
/// <summary>Returns the result of a componentwise unary minus operation on a double3x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double3x3 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator - (double3x3 val) { return new double3x3 (-val.c0, -val.c1, -val.c2); }
/// <summary>Returns the result of a componentwise unary plus operation on a double3x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double3x3 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 operator + (double3x3 val) { return new double3x3 (+val.c0, +val.c1, +val.c2); }
/// <summary>Returns the result of a componentwise equality operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise equality.</param>
/// <returns>bool3x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator == (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool3x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator == (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise equality.</param>
/// <returns>bool3x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator == (double lhs, double3x3 rhs) { return new bool3x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two double3x3 matrices.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise not equal.</param>
/// <returns>bool3x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator != (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on a double3x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool3x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator != (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double3x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double3x3 to use to compute componentwise not equal.</param>
/// <returns>bool3x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator != (double lhs, double3x3 rhs) { return new bool3x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the double3 element at a specified index.</summary>
unsafe public ref double3 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (double3x3* array = &this) { return ref ((double3*)array)[index]; }
}
}
/// <summary>Returns true if the double3x3 is equal to a given double3x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double3x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the double3x3 is equal to a given double3x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double3x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the double3x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double3x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z);
}
/// <summary>Returns a string representation of the double3x3 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a double3x3 matrix constructed from three double3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>double3x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(double3 c0, double3 c1, double3 c2) { return new double3x3(c0, c1, c2); }
/// <summary>Returns a double3x3 matrix constructed from from 9 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <returns>double3x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(double m00, double m01, double m02,
double m10, double m11, double m12,
double m20, double m21, double m22)
{
return new double3x3(m00, m01, m02,
m10, m11, m12,
m20, m21, m22);
}
/// <summary>Returns a double3x3 matrix constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(double v) { return new double3x3(v); }
/// <summary>Returns a double3x3 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(bool v) { return new double3x3(v); }
/// <summary>Return a double3x3 matrix constructed from a bool3x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x3 to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(bool3x3 v) { return new double3x3(v); }
/// <summary>Returns a double3x3 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(int v) { return new double3x3(v); }
/// <summary>Return a double3x3 matrix constructed from a int3x3 matrix by componentwise conversion.</summary>
/// <param name="v">int3x3 to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(int3x3 v) { return new double3x3(v); }
/// <summary>Returns a double3x3 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(uint v) { return new double3x3(v); }
/// <summary>Return a double3x3 matrix constructed from a uint3x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x3 to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(uint3x3 v) { return new double3x3(v); }
/// <summary>Returns a double3x3 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(float v) { return new double3x3(v); }
/// <summary>Return a double3x3 matrix constructed from a float3x3 matrix by componentwise conversion.</summary>
/// <param name="v">float3x3 to convert to double3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 double3x3(float3x3 v) { return new double3x3(v); }
/// <summary>Return the double3x3 transpose of a double3x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x3 transpose(double3x3 v)
{
return double3x3(
v.c0.x, v.c0.y, v.c0.z,
v.c1.x, v.c1.y, v.c1.z,
v.c2.x, v.c2.y, v.c2.z);
}
/// <summary>Returns the double3x3 full inverse of a double3x3 matrix.</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
public static double3x3 inverse(double3x3 m)
{
double3 c0 = m.c0;
double3 c1 = m.c1;
double3 c2 = m.c2;
double3 t0 = double3(c1.x, c2.x, c0.x);
double3 t1 = double3(c1.y, c2.y, c0.y);
double3 t2 = double3(c1.z, c2.z, c0.z);
double3 m0 = t1 * t2.yzx - t1.yzx * t2;
double3 m1 = t0.yzx * t2 - t0 * t2.yzx;
double3 m2 = t0 * t1.yzx - t0.yzx * t1;
double rcpDet = 1.0 / csum(t0.zxy * m0);
return double3x3(m0, m1, m2) * rcpDet;
}
/// <summary>Returns the determinant of a double3x3 matrix.</summary>
/// <param name="m">Matrix to use when computing determinant.</param>
/// <returns>The determinant of the matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double determinant(double3x3 m)
{
double3 c0 = m.c0;
double3 c1 = m.c1;
double3 c2 = m.c2;
double m00 = c1.y * c2.z - c1.z * c2.y;
double m01 = c0.y * c2.z - c0.z * c2.y;
double m02 = c0.y * c1.z - c0.z * c1.y;
return c0.x * m00 - c1.x * m01 + c2.x * m02;
}
/// <summary>Returns a uint hash code of a double3x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double3x3 v)
{
return csum(fold_to_uint(v.c0) * uint3(0xAC5DB57Bu, 0xA91A02EDu, 0xB3C49313u) +
fold_to_uint(v.c1) * uint3(0xF43A9ABBu, 0x84E7E01Bu, 0x8E055BE5u) +
fold_to_uint(v.c2) * uint3(0x6E624EB7u, 0x7383ED49u, 0xDD49C23Bu)) + 0xEBD0D005u;
}
/// <summary>
/// Returns a uint3 vector hash code of a double3x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint3 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint3 hashwide(double3x3 v)
{
return (fold_to_uint(v.c0) * uint3(0x91475DF7u, 0x55E84827u, 0x90A285BBu) +
fold_to_uint(v.c1) * uint3(0x5D19E1D5u, 0xFAAF07DDu, 0x625C45BDu) +
fold_to_uint(v.c2) * uint3(0xC9F27FCBu, 0x6D2523B1u, 0x6E2BF6A9u)) + 0xCC74B3B7u;
}
}
}

View File

@@ -0,0 +1,699 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 3x4 matrix of doubles.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double3x4 : System.IEquatable<double3x4>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public double3 c0;
/// <summary>Column 1 of the matrix.</summary>
public double3 c1;
/// <summary>Column 2 of the matrix.</summary>
public double3 c2;
/// <summary>Column 3 of the matrix.</summary>
public double3 c3;
/// <summary>double3x4 zero value.</summary>
public static readonly double3x4 zero;
/// <summary>Constructs a double3x4 matrix from four double3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(double3 c0, double3 c1, double3 c2, double3 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a double3x4 matrix from 12 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(double m00, double m01, double m02, double m03,
double m10, double m11, double m12, double m13,
double m20, double m21, double m22, double m23)
{
this.c0 = new double3(m00, m10, m20);
this.c1 = new double3(m01, m11, m21);
this.c2 = new double3(m02, m12, m22);
this.c3 = new double3(m03, m13, m23);
}
/// <summary>Constructs a double3x4 matrix from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(double v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double3x4 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(bool v)
{
this.c0 = math.select(new double3(0.0), new double3(1.0), v);
this.c1 = math.select(new double3(0.0), new double3(1.0), v);
this.c2 = math.select(new double3(0.0), new double3(1.0), v);
this.c3 = math.select(new double3(0.0), new double3(1.0), v);
}
/// <summary>Constructs a double3x4 matrix from a bool3x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x4 to convert to double3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(bool3x4 v)
{
this.c0 = math.select(new double3(0.0), new double3(1.0), v.c0);
this.c1 = math.select(new double3(0.0), new double3(1.0), v.c1);
this.c2 = math.select(new double3(0.0), new double3(1.0), v.c2);
this.c3 = math.select(new double3(0.0), new double3(1.0), v.c3);
}
/// <summary>Constructs a double3x4 matrix from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double3x4 matrix from a int3x4 matrix by componentwise conversion.</summary>
/// <param name="v">int3x4 to convert to double3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(int3x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a double3x4 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double3x4 matrix from a uint3x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x4 to convert to double3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(uint3x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a double3x4 matrix from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double3x4 matrix from a float3x4 matrix by componentwise conversion.</summary>
/// <param name="v">float3x4 to convert to double3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double3x4(float3x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Implicitly converts a single double value to a double3x4 matrix by assigning it to every component.</summary>
/// <param name="v">double to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x4(double v) { return new double3x4(v); }
/// <summary>Explicitly converts a single bool value to a double3x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double3x4(bool v) { return new double3x4(v); }
/// <summary>Explicitly converts a bool3x4 matrix to a double3x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x4 to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double3x4(bool3x4 v) { return new double3x4(v); }
/// <summary>Implicitly converts a single int value to a double3x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x4(int v) { return new double3x4(v); }
/// <summary>Implicitly converts a int3x4 matrix to a double3x4 matrix by componentwise conversion.</summary>
/// <param name="v">int3x4 to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x4(int3x4 v) { return new double3x4(v); }
/// <summary>Implicitly converts a single uint value to a double3x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x4(uint v) { return new double3x4(v); }
/// <summary>Implicitly converts a uint3x4 matrix to a double3x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x4 to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x4(uint3x4 v) { return new double3x4(v); }
/// <summary>Implicitly converts a single float value to a double3x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x4(float v) { return new double3x4(v); }
/// <summary>Implicitly converts a float3x4 matrix to a double3x4 matrix by componentwise conversion.</summary>
/// <param name="v">float3x4 to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double3x4(float3x4 v) { return new double3x4(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise multiplication.</param>
/// <returns>double3x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator * (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
/// <summary>Returns the result of a componentwise multiplication operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double3x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator * (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise multiplication.</param>
/// <returns>double3x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator * (double lhs, double3x4 rhs) { return new double3x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise addition.</param>
/// <returns>double3x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator + (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double3x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator + (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise addition.</param>
/// <returns>double3x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator + (double lhs, double3x4 rhs) { return new double3x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise subtraction.</param>
/// <returns>double3x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator - (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double3x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator - (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise subtraction.</param>
/// <returns>double3x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator - (double lhs, double3x4 rhs) { return new double3x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise division.</param>
/// <returns>double3x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator / (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double3x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator / (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise division.</param>
/// <returns>double3x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator / (double lhs, double3x4 rhs) { return new double3x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise modulus.</param>
/// <returns>double3x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator % (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double3x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator % (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise modulus.</param>
/// <returns>double3x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator % (double lhs, double3x4 rhs) { return new double3x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
/// <summary>Returns the result of a componentwise increment operation on a double3x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double3x4 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator ++ (double3x4 val) { return new double3x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
/// <summary>Returns the result of a componentwise decrement operation on a double3x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double3x4 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator -- (double3x4 val) { return new double3x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
/// <summary>Returns the result of a componentwise less than operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise less than.</param>
/// <returns>bool3x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator < (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
/// <summary>Returns the result of a componentwise less than operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool3x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator < (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise less than.</param>
/// <returns>bool3x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator < (double lhs, double3x4 rhs) { return new bool3x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise less or equal.</param>
/// <returns>bool3x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator <= (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool3x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator <= (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise less or equal.</param>
/// <returns>bool3x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator <= (double lhs, double3x4 rhs) { return new bool3x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise greater than.</param>
/// <returns>bool3x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator > (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool3x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator > (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise greater than.</param>
/// <returns>bool3x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator > (double lhs, double3x4 rhs) { return new bool3x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator >= (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool3x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator >= (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator >= (double lhs, double3x4 rhs) { return new bool3x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
/// <summary>Returns the result of a componentwise unary minus operation on a double3x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double3x4 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator - (double3x4 val) { return new double3x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
/// <summary>Returns the result of a componentwise unary plus operation on a double3x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double3x4 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 operator + (double3x4 val) { return new double3x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
/// <summary>Returns the result of a componentwise equality operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise equality.</param>
/// <returns>bool3x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator == (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool3x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator == (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise equality.</param>
/// <returns>bool3x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator == (double lhs, double3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two double3x4 matrices.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise not equal.</param>
/// <returns>bool3x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator != (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on a double3x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double3x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool3x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator != (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double3x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double3x4 to use to compute componentwise not equal.</param>
/// <returns>bool3x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator != (double lhs, double3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the double3 element at a specified index.</summary>
unsafe public ref double3 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (double3x4* array = &this) { return ref ((double3*)array)[index]; }
}
}
/// <summary>Returns true if the double3x4 is equal to a given double3x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the double3x4 is equal to a given double3x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double3x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the double3x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double3x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z);
}
/// <summary>Returns a string representation of the double3x4 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a double3x4 matrix constructed from four double3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>double3x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(double3 c0, double3 c1, double3 c2, double3 c3) { return new double3x4(c0, c1, c2, c3); }
/// <summary>Returns a double3x4 matrix constructed from from 12 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
/// <returns>double3x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(double m00, double m01, double m02, double m03,
double m10, double m11, double m12, double m13,
double m20, double m21, double m22, double m23)
{
return new double3x4(m00, m01, m02, m03,
m10, m11, m12, m13,
m20, m21, m22, m23);
}
/// <summary>Returns a double3x4 matrix constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(double v) { return new double3x4(v); }
/// <summary>Returns a double3x4 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(bool v) { return new double3x4(v); }
/// <summary>Return a double3x4 matrix constructed from a bool3x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x4 to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(bool3x4 v) { return new double3x4(v); }
/// <summary>Returns a double3x4 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(int v) { return new double3x4(v); }
/// <summary>Return a double3x4 matrix constructed from a int3x4 matrix by componentwise conversion.</summary>
/// <param name="v">int3x4 to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(int3x4 v) { return new double3x4(v); }
/// <summary>Returns a double3x4 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(uint v) { return new double3x4(v); }
/// <summary>Return a double3x4 matrix constructed from a uint3x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x4 to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(uint3x4 v) { return new double3x4(v); }
/// <summary>Returns a double3x4 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(float v) { return new double3x4(v); }
/// <summary>Return a double3x4 matrix constructed from a float3x4 matrix by componentwise conversion.</summary>
/// <param name="v">float3x4 to convert to double3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 double3x4(float3x4 v) { return new double3x4(v); }
/// <summary>Return the double4x3 transpose of a double3x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 transpose(double3x4 v)
{
return double4x3(
v.c0.x, v.c0.y, v.c0.z,
v.c1.x, v.c1.y, v.c1.z,
v.c2.x, v.c2.y, v.c2.z,
v.c3.x, v.c3.y, v.c3.z);
}
/// <summary>Fast matrix inverse for rigid transforms (orthonormal basis and translation)</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
public static double3x4 fastinverse(double3x4 m)
{
double3 c0 = m.c0;
double3 c1 = m.c1;
double3 c2 = m.c2;
double3 pos = m.c3;
double3 r0 = double3(c0.x, c1.x, c2.x);
double3 r1 = double3(c0.y, c1.y, c2.y);
double3 r2 = double3(c0.z, c1.z, c2.z);
pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z);
return double3x4(r0, r1, r2, pos);
}
/// <summary>Returns a uint hash code of a double3x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double3x4 v)
{
return csum(fold_to_uint(v.c0) * uint3(0xEE390C97u, 0x9C8A2F05u, 0x4DDC6509u) +
fold_to_uint(v.c1) * uint3(0x7CF083CBu, 0x5C4D6CEDu, 0xF9137117u) +
fold_to_uint(v.c2) * uint3(0xE857DCE1u, 0xF62213C5u, 0x9CDAA959u) +
fold_to_uint(v.c3) * uint3(0xAA269ABFu, 0xD54BA36Fu, 0xFD0847B9u)) + 0x8189A683u;
}
/// <summary>
/// Returns a uint3 vector hash code of a double3x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint3 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint3 hashwide(double3x4 v)
{
return (fold_to_uint(v.c0) * uint3(0xB139D651u, 0xE7579997u, 0xEF7D56C7u) +
fold_to_uint(v.c1) * uint3(0x66F38F0Bu, 0x624256A3u, 0x5292ADE1u) +
fold_to_uint(v.c2) * uint3(0xD2E590E5u, 0xF25BE857u, 0x9BC17CE7u) +
fold_to_uint(v.c3) * uint3(0xC8B86851u, 0x64095221u, 0xADF428FFu)) + 0xA3977109u;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,639 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 4x2 matrix of doubles.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double4x2 : System.IEquatable<double4x2>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public double4 c0;
/// <summary>Column 1 of the matrix.</summary>
public double4 c1;
/// <summary>double4x2 zero value.</summary>
public static readonly double4x2 zero;
/// <summary>Constructs a double4x2 matrix from two double4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(double4 c0, double4 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a double4x2 matrix from 8 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(double m00, double m01,
double m10, double m11,
double m20, double m21,
double m30, double m31)
{
this.c0 = new double4(m00, m10, m20, m30);
this.c1 = new double4(m01, m11, m21, m31);
}
/// <summary>Constructs a double4x2 matrix from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(double v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double4x2 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(bool v)
{
this.c0 = math.select(new double4(0.0), new double4(1.0), v);
this.c1 = math.select(new double4(0.0), new double4(1.0), v);
}
/// <summary>Constructs a double4x2 matrix from a bool4x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x2 to convert to double4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(bool4x2 v)
{
this.c0 = math.select(new double4(0.0), new double4(1.0), v.c0);
this.c1 = math.select(new double4(0.0), new double4(1.0), v.c1);
}
/// <summary>Constructs a double4x2 matrix from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(int v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double4x2 matrix from a int4x2 matrix by componentwise conversion.</summary>
/// <param name="v">int4x2 to convert to double4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(int4x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a double4x2 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(uint v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double4x2 matrix from a uint4x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x2 to convert to double4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(uint4x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a double4x2 matrix from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(float v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a double4x2 matrix from a float4x2 matrix by componentwise conversion.</summary>
/// <param name="v">float4x2 to convert to double4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x2(float4x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Implicitly converts a single double value to a double4x2 matrix by assigning it to every component.</summary>
/// <param name="v">double to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x2(double v) { return new double4x2(v); }
/// <summary>Explicitly converts a single bool value to a double4x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double4x2(bool v) { return new double4x2(v); }
/// <summary>Explicitly converts a bool4x2 matrix to a double4x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x2 to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double4x2(bool4x2 v) { return new double4x2(v); }
/// <summary>Implicitly converts a single int value to a double4x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x2(int v) { return new double4x2(v); }
/// <summary>Implicitly converts a int4x2 matrix to a double4x2 matrix by componentwise conversion.</summary>
/// <param name="v">int4x2 to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x2(int4x2 v) { return new double4x2(v); }
/// <summary>Implicitly converts a single uint value to a double4x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x2(uint v) { return new double4x2(v); }
/// <summary>Implicitly converts a uint4x2 matrix to a double4x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x2 to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x2(uint4x2 v) { return new double4x2(v); }
/// <summary>Implicitly converts a single float value to a double4x2 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x2(float v) { return new double4x2(v); }
/// <summary>Implicitly converts a float4x2 matrix to a double4x2 matrix by componentwise conversion.</summary>
/// <param name="v">float4x2 to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x2(float4x2 v) { return new double4x2(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise multiplication.</param>
/// <returns>double4x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator * (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
/// <summary>Returns the result of a componentwise multiplication operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double4x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator * (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise multiplication.</param>
/// <returns>double4x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator * (double lhs, double4x2 rhs) { return new double4x2 (lhs * rhs.c0, lhs * rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise addition.</param>
/// <returns>double4x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator + (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double4x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator + (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise addition.</param>
/// <returns>double4x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator + (double lhs, double4x2 rhs) { return new double4x2 (lhs + rhs.c0, lhs + rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise subtraction.</param>
/// <returns>double4x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator - (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double4x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator - (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise subtraction.</param>
/// <returns>double4x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator - (double lhs, double4x2 rhs) { return new double4x2 (lhs - rhs.c0, lhs - rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise division.</param>
/// <returns>double4x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator / (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double4x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator / (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise division.</param>
/// <returns>double4x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator / (double lhs, double4x2 rhs) { return new double4x2 (lhs / rhs.c0, lhs / rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise modulus.</param>
/// <returns>double4x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator % (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double4x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator % (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise modulus.</param>
/// <returns>double4x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator % (double lhs, double4x2 rhs) { return new double4x2 (lhs % rhs.c0, lhs % rhs.c1); }
/// <summary>Returns the result of a componentwise increment operation on a double4x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double4x2 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator ++ (double4x2 val) { return new double4x2 (++val.c0, ++val.c1); }
/// <summary>Returns the result of a componentwise decrement operation on a double4x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double4x2 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator -- (double4x2 val) { return new double4x2 (--val.c0, --val.c1); }
/// <summary>Returns the result of a componentwise less than operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise less than.</param>
/// <returns>bool4x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator < (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
/// <summary>Returns the result of a componentwise less than operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool4x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator < (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise less than.</param>
/// <returns>bool4x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator < (double lhs, double4x2 rhs) { return new bool4x2 (lhs < rhs.c0, lhs < rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise less or equal.</param>
/// <returns>bool4x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator <= (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool4x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator <= (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise less or equal.</param>
/// <returns>bool4x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator <= (double lhs, double4x2 rhs) { return new bool4x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise greater than.</param>
/// <returns>bool4x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator > (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool4x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator > (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise greater than.</param>
/// <returns>bool4x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator > (double lhs, double4x2 rhs) { return new bool4x2 (lhs > rhs.c0, lhs > rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator >= (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool4x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator >= (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator >= (double lhs, double4x2 rhs) { return new bool4x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
/// <summary>Returns the result of a componentwise unary minus operation on a double4x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double4x2 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator - (double4x2 val) { return new double4x2 (-val.c0, -val.c1); }
/// <summary>Returns the result of a componentwise unary plus operation on a double4x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double4x2 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 operator + (double4x2 val) { return new double4x2 (+val.c0, +val.c1); }
/// <summary>Returns the result of a componentwise equality operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise equality.</param>
/// <returns>bool4x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator == (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool4x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator == (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise equality.</param>
/// <returns>bool4x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator == (double lhs, double4x2 rhs) { return new bool4x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two double4x2 matrices.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise not equal.</param>
/// <returns>bool4x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator != (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on a double4x2 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool4x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator != (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double4x2 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double4x2 to use to compute componentwise not equal.</param>
/// <returns>bool4x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator != (double lhs, double4x2 rhs) { return new bool4x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the double4 element at a specified index.</summary>
unsafe public ref double4 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (double4x2* array = &this) { return ref ((double4*)array)[index]; }
}
}
/// <summary>Returns true if the double4x2 is equal to a given double4x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double4x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the double4x2 is equal to a given double4x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double4x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the double4x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double4x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z, c0.w, c1.w);
}
/// <summary>Returns a string representation of the double4x2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a double4x2 matrix constructed from two double4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>double4x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(double4 c0, double4 c1) { return new double4x2(c0, c1); }
/// <summary>Returns a double4x2 matrix constructed from from 8 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <returns>double4x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(double m00, double m01,
double m10, double m11,
double m20, double m21,
double m30, double m31)
{
return new double4x2(m00, m01,
m10, m11,
m20, m21,
m30, m31);
}
/// <summary>Returns a double4x2 matrix constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(double v) { return new double4x2(v); }
/// <summary>Returns a double4x2 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(bool v) { return new double4x2(v); }
/// <summary>Return a double4x2 matrix constructed from a bool4x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x2 to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(bool4x2 v) { return new double4x2(v); }
/// <summary>Returns a double4x2 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(int v) { return new double4x2(v); }
/// <summary>Return a double4x2 matrix constructed from a int4x2 matrix by componentwise conversion.</summary>
/// <param name="v">int4x2 to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(int4x2 v) { return new double4x2(v); }
/// <summary>Returns a double4x2 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(uint v) { return new double4x2(v); }
/// <summary>Return a double4x2 matrix constructed from a uint4x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x2 to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(uint4x2 v) { return new double4x2(v); }
/// <summary>Returns a double4x2 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(float v) { return new double4x2(v); }
/// <summary>Return a double4x2 matrix constructed from a float4x2 matrix by componentwise conversion.</summary>
/// <param name="v">float4x2 to convert to double4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x2 double4x2(float4x2 v) { return new double4x2(v); }
/// <summary>Return the double2x4 transpose of a double4x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2x4 transpose(double4x2 v)
{
return double2x4(
v.c0.x, v.c0.y, v.c0.z, v.c0.w,
v.c1.x, v.c1.y, v.c1.z, v.c1.w);
}
/// <summary>Returns a uint hash code of a double4x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double4x2 v)
{
return csum(fold_to_uint(v.c0) * uint4(0x5AB3E8CDu, 0x676E8407u, 0xB36DE767u, 0x6FCA387Du) +
fold_to_uint(v.c1) * uint4(0xAF0F3103u, 0xE4A056C7u, 0x841D8225u, 0xC9393C7Du)) + 0xD42EAFA3u;
}
/// <summary>
/// Returns a uint4 vector hash code of a double4x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint4 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(double4x2 v)
{
return (fold_to_uint(v.c0) * uint4(0xD9AFD06Du, 0x97A65421u, 0x7809205Fu, 0x9C9F0823u) +
fold_to_uint(v.c1) * uint4(0x5A9CA13Bu, 0xAFCDD5EFu, 0xA88D187Du, 0xCF6EBA1Du)) + 0x9D88E5A1u;
}
}
}

View File

@@ -0,0 +1,665 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 4x3 matrix of doubles.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double4x3 : System.IEquatable<double4x3>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public double4 c0;
/// <summary>Column 1 of the matrix.</summary>
public double4 c1;
/// <summary>Column 2 of the matrix.</summary>
public double4 c2;
/// <summary>double4x3 zero value.</summary>
public static readonly double4x3 zero;
/// <summary>Constructs a double4x3 matrix from three double4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(double4 c0, double4 c1, double4 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a double4x3 matrix from 12 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(double m00, double m01, double m02,
double m10, double m11, double m12,
double m20, double m21, double m22,
double m30, double m31, double m32)
{
this.c0 = new double4(m00, m10, m20, m30);
this.c1 = new double4(m01, m11, m21, m31);
this.c2 = new double4(m02, m12, m22, m32);
}
/// <summary>Constructs a double4x3 matrix from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(double v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double4x3 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(bool v)
{
this.c0 = math.select(new double4(0.0), new double4(1.0), v);
this.c1 = math.select(new double4(0.0), new double4(1.0), v);
this.c2 = math.select(new double4(0.0), new double4(1.0), v);
}
/// <summary>Constructs a double4x3 matrix from a bool4x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x3 to convert to double4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(bool4x3 v)
{
this.c0 = math.select(new double4(0.0), new double4(1.0), v.c0);
this.c1 = math.select(new double4(0.0), new double4(1.0), v.c1);
this.c2 = math.select(new double4(0.0), new double4(1.0), v.c2);
}
/// <summary>Constructs a double4x3 matrix from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double4x3 matrix from a int4x3 matrix by componentwise conversion.</summary>
/// <param name="v">int4x3 to convert to double4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(int4x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a double4x3 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double4x3 matrix from a uint4x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x3 to convert to double4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(uint4x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a double4x3 matrix from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a double4x3 matrix from a float4x3 matrix by componentwise conversion.</summary>
/// <param name="v">float4x3 to convert to double4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x3(float4x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Implicitly converts a single double value to a double4x3 matrix by assigning it to every component.</summary>
/// <param name="v">double to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x3(double v) { return new double4x3(v); }
/// <summary>Explicitly converts a single bool value to a double4x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double4x3(bool v) { return new double4x3(v); }
/// <summary>Explicitly converts a bool4x3 matrix to a double4x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x3 to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double4x3(bool4x3 v) { return new double4x3(v); }
/// <summary>Implicitly converts a single int value to a double4x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x3(int v) { return new double4x3(v); }
/// <summary>Implicitly converts a int4x3 matrix to a double4x3 matrix by componentwise conversion.</summary>
/// <param name="v">int4x3 to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x3(int4x3 v) { return new double4x3(v); }
/// <summary>Implicitly converts a single uint value to a double4x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x3(uint v) { return new double4x3(v); }
/// <summary>Implicitly converts a uint4x3 matrix to a double4x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x3 to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x3(uint4x3 v) { return new double4x3(v); }
/// <summary>Implicitly converts a single float value to a double4x3 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x3(float v) { return new double4x3(v); }
/// <summary>Implicitly converts a float4x3 matrix to a double4x3 matrix by componentwise conversion.</summary>
/// <param name="v">float4x3 to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x3(float4x3 v) { return new double4x3(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise multiplication.</param>
/// <returns>double4x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator * (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); }
/// <summary>Returns the result of a componentwise multiplication operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double4x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator * (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise multiplication.</param>
/// <returns>double4x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator * (double lhs, double4x3 rhs) { return new double4x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise addition.</param>
/// <returns>double4x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator + (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double4x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator + (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise addition.</param>
/// <returns>double4x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator + (double lhs, double4x3 rhs) { return new double4x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise subtraction.</param>
/// <returns>double4x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator - (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double4x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator - (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise subtraction.</param>
/// <returns>double4x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator - (double lhs, double4x3 rhs) { return new double4x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise division.</param>
/// <returns>double4x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator / (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double4x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator / (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise division.</param>
/// <returns>double4x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator / (double lhs, double4x3 rhs) { return new double4x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise modulus.</param>
/// <returns>double4x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator % (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double4x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator % (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise modulus.</param>
/// <returns>double4x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator % (double lhs, double4x3 rhs) { return new double4x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); }
/// <summary>Returns the result of a componentwise increment operation on a double4x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double4x3 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator ++ (double4x3 val) { return new double4x3 (++val.c0, ++val.c1, ++val.c2); }
/// <summary>Returns the result of a componentwise decrement operation on a double4x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double4x3 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator -- (double4x3 val) { return new double4x3 (--val.c0, --val.c1, --val.c2); }
/// <summary>Returns the result of a componentwise less than operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise less than.</param>
/// <returns>bool4x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator < (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); }
/// <summary>Returns the result of a componentwise less than operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool4x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator < (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise less than.</param>
/// <returns>bool4x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator < (double lhs, double4x3 rhs) { return new bool4x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise less or equal.</param>
/// <returns>bool4x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator <= (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool4x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator <= (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise less or equal.</param>
/// <returns>bool4x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator <= (double lhs, double4x3 rhs) { return new bool4x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise greater than.</param>
/// <returns>bool4x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator > (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool4x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator > (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise greater than.</param>
/// <returns>bool4x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator > (double lhs, double4x3 rhs) { return new bool4x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator >= (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool4x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator >= (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator >= (double lhs, double4x3 rhs) { return new bool4x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); }
/// <summary>Returns the result of a componentwise unary minus operation on a double4x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double4x3 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator - (double4x3 val) { return new double4x3 (-val.c0, -val.c1, -val.c2); }
/// <summary>Returns the result of a componentwise unary plus operation on a double4x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double4x3 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 operator + (double4x3 val) { return new double4x3 (+val.c0, +val.c1, +val.c2); }
/// <summary>Returns the result of a componentwise equality operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise equality.</param>
/// <returns>bool4x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator == (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool4x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator == (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise equality.</param>
/// <returns>bool4x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator == (double lhs, double4x3 rhs) { return new bool4x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two double4x3 matrices.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise not equal.</param>
/// <returns>bool4x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator != (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on a double4x3 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool4x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator != (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double4x3 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double4x3 to use to compute componentwise not equal.</param>
/// <returns>bool4x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator != (double lhs, double4x3 rhs) { return new bool4x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the double4 element at a specified index.</summary>
unsafe public ref double4 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (double4x3* array = &this) { return ref ((double4*)array)[index]; }
}
}
/// <summary>Returns true if the double4x3 is equal to a given double4x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double4x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the double4x3 is equal to a given double4x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double4x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the double4x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double4x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z, c0.w, c1.w, c2.w);
}
/// <summary>Returns a string representation of the double4x3 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a double4x3 matrix constructed from three double4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>double4x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(double4 c0, double4 c1, double4 c2) { return new double4x3(c0, c1, c2); }
/// <summary>Returns a double4x3 matrix constructed from from 12 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
/// <returns>double4x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(double m00, double m01, double m02,
double m10, double m11, double m12,
double m20, double m21, double m22,
double m30, double m31, double m32)
{
return new double4x3(m00, m01, m02,
m10, m11, m12,
m20, m21, m22,
m30, m31, m32);
}
/// <summary>Returns a double4x3 matrix constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(double v) { return new double4x3(v); }
/// <summary>Returns a double4x3 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(bool v) { return new double4x3(v); }
/// <summary>Return a double4x3 matrix constructed from a bool4x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x3 to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(bool4x3 v) { return new double4x3(v); }
/// <summary>Returns a double4x3 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(int v) { return new double4x3(v); }
/// <summary>Return a double4x3 matrix constructed from a int4x3 matrix by componentwise conversion.</summary>
/// <param name="v">int4x3 to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(int4x3 v) { return new double4x3(v); }
/// <summary>Returns a double4x3 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(uint v) { return new double4x3(v); }
/// <summary>Return a double4x3 matrix constructed from a uint4x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x3 to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(uint4x3 v) { return new double4x3(v); }
/// <summary>Returns a double4x3 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(float v) { return new double4x3(v); }
/// <summary>Return a double4x3 matrix constructed from a float4x3 matrix by componentwise conversion.</summary>
/// <param name="v">float4x3 to convert to double4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x3 double4x3(float4x3 v) { return new double4x3(v); }
/// <summary>Return the double3x4 transpose of a double4x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3x4 transpose(double4x3 v)
{
return double3x4(
v.c0.x, v.c0.y, v.c0.z, v.c0.w,
v.c1.x, v.c1.y, v.c1.z, v.c1.w,
v.c2.x, v.c2.y, v.c2.z, v.c2.w);
}
/// <summary>Returns a uint hash code of a double4x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double4x3 v)
{
return csum(fold_to_uint(v.c0) * uint4(0x7AA07CD3u, 0xAF642BA9u, 0xA8F2213Bu, 0x9F3FDC37u) +
fold_to_uint(v.c1) * uint4(0xAC60D0C3u, 0x9263662Fu, 0xE69626FFu, 0xBD010EEBu) +
fold_to_uint(v.c2) * uint4(0x9CEDE1D1u, 0x43BE0B51u, 0xAF836EE1u, 0xB130C137u)) + 0x54834775u;
}
/// <summary>
/// Returns a uint4 vector hash code of a double4x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint4 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(double4x3 v)
{
return (fold_to_uint(v.c0) * uint4(0x7C022221u, 0xA2D00EDFu, 0xA8977779u, 0x9F1C739Bu) +
fold_to_uint(v.c1) * uint4(0x4B1BD187u, 0x9DF50593u, 0xF18EEB85u, 0x9E19BFC3u) +
fold_to_uint(v.c2) * uint4(0x8196B06Fu, 0xD24EFA19u, 0x7D8048BBu, 0x713BD06Fu)) + 0x753AD6ADu;
}
}
}

View File

@@ -0,0 +1,824 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 4x4 matrix of doubles.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct double4x4 : System.IEquatable<double4x4>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public double4 c0;
/// <summary>Column 1 of the matrix.</summary>
public double4 c1;
/// <summary>Column 2 of the matrix.</summary>
public double4 c2;
/// <summary>Column 3 of the matrix.</summary>
public double4 c3;
/// <summary>double4x4 identity transform.</summary>
public static readonly double4x4 identity = new double4x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
/// <summary>double4x4 zero value.</summary>
public static readonly double4x4 zero;
/// <summary>Constructs a double4x4 matrix from four double4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(double4 c0, double4 c1, double4 c2, double4 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a double4x4 matrix from 16 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
/// <param name="m33">The matrix at row 3, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(double m00, double m01, double m02, double m03,
double m10, double m11, double m12, double m13,
double m20, double m21, double m22, double m23,
double m30, double m31, double m32, double m33)
{
this.c0 = new double4(m00, m10, m20, m30);
this.c1 = new double4(m01, m11, m21, m31);
this.c2 = new double4(m02, m12, m22, m32);
this.c3 = new double4(m03, m13, m23, m33);
}
/// <summary>Constructs a double4x4 matrix from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(double v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double4x4 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(bool v)
{
this.c0 = math.select(new double4(0.0), new double4(1.0), v);
this.c1 = math.select(new double4(0.0), new double4(1.0), v);
this.c2 = math.select(new double4(0.0), new double4(1.0), v);
this.c3 = math.select(new double4(0.0), new double4(1.0), v);
}
/// <summary>Constructs a double4x4 matrix from a bool4x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x4 to convert to double4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(bool4x4 v)
{
this.c0 = math.select(new double4(0.0), new double4(1.0), v.c0);
this.c1 = math.select(new double4(0.0), new double4(1.0), v.c1);
this.c2 = math.select(new double4(0.0), new double4(1.0), v.c2);
this.c3 = math.select(new double4(0.0), new double4(1.0), v.c3);
}
/// <summary>Constructs a double4x4 matrix from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double4x4 matrix from a int4x4 matrix by componentwise conversion.</summary>
/// <param name="v">int4x4 to convert to double4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(int4x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a double4x4 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double4x4 matrix from a uint4x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x4 to convert to double4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(uint4x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a double4x4 matrix from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a double4x4 matrix from a float4x4 matrix by componentwise conversion.</summary>
/// <param name="v">float4x4 to convert to double4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double4x4(float4x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Implicitly converts a single double value to a double4x4 matrix by assigning it to every component.</summary>
/// <param name="v">double to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x4(double v) { return new double4x4(v); }
/// <summary>Explicitly converts a single bool value to a double4x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double4x4(bool v) { return new double4x4(v); }
/// <summary>Explicitly converts a bool4x4 matrix to a double4x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x4 to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator double4x4(bool4x4 v) { return new double4x4(v); }
/// <summary>Implicitly converts a single int value to a double4x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x4(int v) { return new double4x4(v); }
/// <summary>Implicitly converts a int4x4 matrix to a double4x4 matrix by componentwise conversion.</summary>
/// <param name="v">int4x4 to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x4(int4x4 v) { return new double4x4(v); }
/// <summary>Implicitly converts a single uint value to a double4x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x4(uint v) { return new double4x4(v); }
/// <summary>Implicitly converts a uint4x4 matrix to a double4x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x4 to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x4(uint4x4 v) { return new double4x4(v); }
/// <summary>Implicitly converts a single float value to a double4x4 matrix by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x4(float v) { return new double4x4(v); }
/// <summary>Implicitly converts a float4x4 matrix to a double4x4 matrix by componentwise conversion.</summary>
/// <param name="v">float4x4 to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double4x4(float4x4 v) { return new double4x4(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise multiplication.</param>
/// <returns>double4x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator * (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
/// <summary>Returns the result of a componentwise multiplication operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
/// <returns>double4x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator * (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise multiplication.</param>
/// <returns>double4x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator * (double lhs, double4x4 rhs) { return new double4x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise addition.</param>
/// <returns>double4x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator + (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
/// <returns>double4x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator + (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise addition.</param>
/// <returns>double4x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator + (double lhs, double4x4 rhs) { return new double4x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise subtraction.</param>
/// <returns>double4x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator - (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
/// <returns>double4x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator - (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise subtraction.</param>
/// <returns>double4x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator - (double lhs, double4x4 rhs) { return new double4x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise division.</param>
/// <returns>double4x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator / (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
/// <returns>double4x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator / (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise division.</param>
/// <returns>double4x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator / (double lhs, double4x4 rhs) { return new double4x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise modulus.</param>
/// <returns>double4x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator % (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
/// <returns>double4x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator % (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise modulus.</param>
/// <returns>double4x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator % (double lhs, double4x4 rhs) { return new double4x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
/// <summary>Returns the result of a componentwise increment operation on a double4x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>double4x4 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator ++ (double4x4 val) { return new double4x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
/// <summary>Returns the result of a componentwise decrement operation on a double4x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>double4x4 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator -- (double4x4 val) { return new double4x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
/// <summary>Returns the result of a componentwise less than operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise less than.</param>
/// <returns>bool4x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator < (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
/// <summary>Returns the result of a componentwise less than operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
/// <returns>bool4x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator < (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise less than.</param>
/// <returns>bool4x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator < (double lhs, double4x4 rhs) { return new bool4x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise less or equal.</param>
/// <returns>bool4x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator <= (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
/// <returns>bool4x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator <= (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise less or equal.</param>
/// <returns>bool4x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator <= (double lhs, double4x4 rhs) { return new bool4x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise greater than.</param>
/// <returns>bool4x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator > (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
/// <returns>bool4x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator > (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise greater than.</param>
/// <returns>bool4x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator > (double lhs, double4x4 rhs) { return new bool4x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator >= (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
/// <returns>bool4x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator >= (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator >= (double lhs, double4x4 rhs) { return new bool4x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
/// <summary>Returns the result of a componentwise unary minus operation on a double4x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>double4x4 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator - (double4x4 val) { return new double4x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
/// <summary>Returns the result of a componentwise unary plus operation on a double4x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>double4x4 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 operator + (double4x4 val) { return new double4x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
/// <summary>Returns the result of a componentwise equality operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise equality.</param>
/// <returns>bool4x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator == (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
/// <returns>bool4x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator == (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise equality.</param>
/// <returns>bool4x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator == (double lhs, double4x4 rhs) { return new bool4x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two double4x4 matrices.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise not equal.</param>
/// <returns>bool4x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator != (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on a double4x4 matrix and a double value.</summary>
/// <param name="lhs">Left hand side double4x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
/// <returns>bool4x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator != (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a double value and a double4x4 matrix.</summary>
/// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side double4x4 to use to compute componentwise not equal.</param>
/// <returns>bool4x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator != (double lhs, double4x4 rhs) { return new bool4x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the double4 element at a specified index.</summary>
unsafe public ref double4 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (double4x4* array = &this) { return ref ((double4*)array)[index]; }
}
}
/// <summary>Returns true if the double4x4 is equal to a given double4x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(double4x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the double4x4 is equal to a given double4x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is double4x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the double4x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the double4x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("double4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z, c0.w, c1.w, c2.w, c3.w);
}
/// <summary>Returns a string representation of the double4x4 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("double4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider), c3.w.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a double4x4 matrix constructed from four double4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>double4x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(double4 c0, double4 c1, double4 c2, double4 c3) { return new double4x4(c0, c1, c2, c3); }
/// <summary>Returns a double4x4 matrix constructed from from 16 double values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
/// <param name="m33">The matrix at row 3, column 3 will be set to this value.</param>
/// <returns>double4x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(double m00, double m01, double m02, double m03,
double m10, double m11, double m12, double m13,
double m20, double m21, double m22, double m23,
double m30, double m31, double m32, double m33)
{
return new double4x4(m00, m01, m02, m03,
m10, m11, m12, m13,
m20, m21, m22, m23,
m30, m31, m32, m33);
}
/// <summary>Returns a double4x4 matrix constructed from a single double value by assigning it to every component.</summary>
/// <param name="v">double to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(double v) { return new double4x4(v); }
/// <summary>Returns a double4x4 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
/// <param name="v">bool to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(bool v) { return new double4x4(v); }
/// <summary>Return a double4x4 matrix constructed from a bool4x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x4 to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(bool4x4 v) { return new double4x4(v); }
/// <summary>Returns a double4x4 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
/// <param name="v">int to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(int v) { return new double4x4(v); }
/// <summary>Return a double4x4 matrix constructed from a int4x4 matrix by componentwise conversion.</summary>
/// <param name="v">int4x4 to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(int4x4 v) { return new double4x4(v); }
/// <summary>Returns a double4x4 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
/// <param name="v">uint to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(uint v) { return new double4x4(v); }
/// <summary>Return a double4x4 matrix constructed from a uint4x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x4 to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(uint4x4 v) { return new double4x4(v); }
/// <summary>Returns a double4x4 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
/// <param name="v">float to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(float v) { return new double4x4(v); }
/// <summary>Return a double4x4 matrix constructed from a float4x4 matrix by componentwise conversion.</summary>
/// <param name="v">float4x4 to convert to double4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 double4x4(float4x4 v) { return new double4x4(v); }
/// <summary>Return the result of rotating a double3 vector by a double4x4 matrix</summary>
/// <param name ="a">Left hand side matrix argument that specifies the rotation.</param>
/// <param name ="b">Right hand side vector argument to be rotated.</param>
/// <returns>The rotated vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3 rotate(double4x4 a, double3 b)
{
return (a.c0 * b.x + a.c1 * b.y + a.c2 * b.z).xyz;
}
/// <summary>Return the result of transforming a double3 point by a double4x4 matrix</summary>
/// <param name ="a">Left hand side matrix argument that specifies the transformation.</param>
/// <param name ="b">Right hand side point argument to be transformed.</param>
/// <returns>The transformed point.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double3 transform(double4x4 a, double3 b)
{
return (a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3).xyz;
}
/// <summary>Return the double4x4 transpose of a double4x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double4x4 transpose(double4x4 v)
{
return double4x4(
v.c0.x, v.c0.y, v.c0.z, v.c0.w,
v.c1.x, v.c1.y, v.c1.z, v.c1.w,
v.c2.x, v.c2.y, v.c2.z, v.c2.w,
v.c3.x, v.c3.y, v.c3.z, v.c3.w);
}
/// <summary>Returns the double4x4 full inverse of a double4x4 matrix.</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
public static double4x4 inverse(double4x4 m)
{
double4 c0 = m.c0;
double4 c1 = m.c1;
double4 c2 = m.c2;
double4 c3 = m.c3;
double4 r0y_r1y_r0x_r1x = movelh(c1, c0);
double4 r0z_r1z_r0w_r1w = movelh(c2, c3);
double4 r2y_r3y_r2x_r3x = movehl(c0, c1);
double4 r2z_r3z_r2w_r3w = movehl(c3, c2);
double4 r1y_r2y_r1x_r2x = shuffle(c1, c0, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ);
double4 r1z_r2z_r1w_r2w = shuffle(c2, c3, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ);
double4 r3y_r0y_r3x_r0x = shuffle(c1, c0, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX);
double4 r3z_r0z_r3w_r0w = shuffle(c2, c3, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX);
double4 r0_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ);
double4 r1_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW);
double4 r2_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ);
double4 r3_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW);
double4 r0_xyzw = shuffle(r0y_r1y_r0x_r1x, r0z_r1z_r0w_r1w, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ);
// Calculate remaining inner term pairs. inner terms have zw=-xy, so we only have to calculate xy and can pack two pairs per vector.
double4 inner12_23 = r1y_r2y_r1x_r2x * r2z_r3z_r2w_r3w - r1z_r2z_r1w_r2w * r2y_r3y_r2x_r3x;
double4 inner02_13 = r0y_r1y_r0x_r1x * r2z_r3z_r2w_r3w - r0z_r1z_r0w_r1w * r2y_r3y_r2x_r3x;
double4 inner30_01 = r3z_r0z_r3w_r0w * r0y_r1y_r0x_r1x - r3y_r0y_r3x_r0x * r0z_r1z_r0w_r1w;
// Expand inner terms back to 4 components. zw signs still need to be flipped
double4 inner12 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX);
double4 inner23 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY);
double4 inner02 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX);
double4 inner13 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY);
// Calculate minors
double4 minors0 = r3_wzyx * inner12 - r2_wzyx * inner13 + r1_wzyx * inner23;
double4 denom = r0_xyzw * minors0;
// Horizontal sum of denominator. Free sign flip of z and w compensates for missing flip in inner terms.
denom = denom + shuffle(denom, denom, ShuffleComponent.LeftY, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightZ); // x+y x+y z+w z+w
denom = denom - shuffle(denom, denom, ShuffleComponent.LeftZ, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.RightX); // x+y-z-w x+y-z-w z+w-x-y z+w-x-y
double4 rcp_denom_ppnn = double4(1.0) / denom;
double4x4 res;
res.c0 = minors0 * rcp_denom_ppnn;
double4 inner30 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX);
double4 inner01 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY);
double4 minors1 = r2_wzyx * inner30 - r0_wzyx * inner23 - r3_wzyx * inner02;
res.c1 = minors1 * rcp_denom_ppnn;
double4 minors2 = r0_wzyx * inner13 - r1_wzyx * inner30 - r3_wzyx * inner01;
res.c2 = minors2 * rcp_denom_ppnn;
double4 minors3 = r1_wzyx * inner02 - r0_wzyx * inner12 + r2_wzyx * inner01;
res.c3 = minors3 * rcp_denom_ppnn;
return res;
}
/// <summary>Fast matrix inverse for rigid transforms (orthonormal basis and translation)</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
public static double4x4 fastinverse(double4x4 m)
{
double4 c0 = m.c0;
double4 c1 = m.c1;
double4 c2 = m.c2;
double4 pos = m.c3;
double4 zero = double4(0);
double4 t0 = unpacklo(c0, c2);
double4 t1 = unpacklo(c1, zero);
double4 t2 = unpackhi(c0, c2);
double4 t3 = unpackhi(c1, zero);
double4 r0 = unpacklo(t0, t1);
double4 r1 = unpackhi(t0, t1);
double4 r2 = unpacklo(t2, t3);
pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z);
pos.w = 1.0f;
return double4x4(r0, r1, r2, pos);
}
/// <summary>Returns the determinant of a double4x4 matrix.</summary>
/// <param name="m">Matrix to use when computing determinant.</param>
/// <returns>The determinant of the matrix.</returns>
public static double determinant(double4x4 m)
{
double4 c0 = m.c0;
double4 c1 = m.c1;
double4 c2 = m.c2;
double4 c3 = m.c3;
double m00 = c1.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c1.z * c3.w - c1.w * c3.z) + c3.y * (c1.z * c2.w - c1.w * c2.z);
double m01 = c0.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c2.w - c0.w * c2.z);
double m02 = c0.y * (c1.z * c3.w - c1.w * c3.z) - c1.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c1.w - c0.w * c1.z);
double m03 = c0.y * (c1.z * c2.w - c1.w * c2.z) - c1.y * (c0.z * c2.w - c0.w * c2.z) + c2.y * (c0.z * c1.w - c0.w * c1.z);
return c0.x * m00 - c1.x * m01 + c2.x * m02 - c3.x * m03;
}
/// <summary>Returns a uint hash code of a double4x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(double4x4 v)
{
return csum(fold_to_uint(v.c0) * uint4(0x4DDC6509u, 0x7CF083CBu, 0x5C4D6CEDu, 0xF9137117u) +
fold_to_uint(v.c1) * uint4(0xE857DCE1u, 0xF62213C5u, 0x9CDAA959u, 0xAA269ABFu) +
fold_to_uint(v.c2) * uint4(0xD54BA36Fu, 0xFD0847B9u, 0x8189A683u, 0xB139D651u) +
fold_to_uint(v.c3) * uint4(0xE7579997u, 0xEF7D56C7u, 0x66F38F0Bu, 0x624256A3u)) + 0x5292ADE1u;
}
/// <summary>
/// Returns a uint4 vector hash code of a double4x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint4 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(double4x4 v)
{
return (fold_to_uint(v.c0) * uint4(0xD2E590E5u, 0xF25BE857u, 0x9BC17CE7u, 0xC8B86851u) +
fold_to_uint(v.c1) * uint4(0x64095221u, 0xADF428FFu, 0xA3977109u, 0x745ED837u) +
fold_to_uint(v.c2) * uint4(0x9CDC88F5u, 0xFA62D721u, 0x7E4DB1CFu, 0x68EEE0F5u) +
fold_to_uint(v.c3) * uint4(0xBC3B0A59u, 0x816EFB5Du, 0xA24E82B7u, 0x45A22087u)) + 0xFC104C3Bu;
}
}
}

View File

@@ -0,0 +1,998 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using System.Diagnostics;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2 component vector of floats.</summary>
[DebuggerTypeProxy(typeof(float2.DebuggerProxy))]
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float2 : System.IEquatable<float2>, IFormattable
{
/// <summary>x component of the vector.</summary>
public float x;
/// <summary>y component of the vector.</summary>
public float y;
/// <summary>float2 zero value.</summary>
public static readonly float2 zero;
/// <summary>Constructs a float2 vector from two float values.</summary>
/// <param name="x">The constructed vector's x component will be set to this value.</param>
/// <param name="y">The constructed vector's y component will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(float x, float y)
{
this.x = x;
this.y = y;
}
/// <summary>Constructs a float2 vector from a float2 vector.</summary>
/// <param name="xy">The constructed vector's xy components will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(float2 xy)
{
this.x = xy.x;
this.y = xy.y;
}
/// <summary>Constructs a float2 vector from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(float v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a float2 vector from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(bool v)
{
this.x = v ? 1.0f : 0.0f;
this.y = v ? 1.0f : 0.0f;
}
/// <summary>Constructs a float2 vector from a bool2 vector by componentwise conversion.</summary>
/// <param name="v">bool2 to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(bool2 v)
{
this.x = v.x ? 1.0f : 0.0f;
this.y = v.y ? 1.0f : 0.0f;
}
/// <summary>Constructs a float2 vector from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(int v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a float2 vector from a int2 vector by componentwise conversion.</summary>
/// <param name="v">int2 to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(int2 v)
{
this.x = v.x;
this.y = v.y;
}
/// <summary>Constructs a float2 vector from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(uint v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a float2 vector from a uint2 vector by componentwise conversion.</summary>
/// <param name="v">uint2 to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(uint2 v)
{
this.x = v.x;
this.y = v.y;
}
/// <summary>Constructs a float2 vector from a single half value by converting it to float and assigning it to every component.</summary>
/// <param name="v">half to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(half v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a float2 vector from a half2 vector by componentwise conversion.</summary>
/// <param name="v">half2 to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(half2 v)
{
this.x = v.x;
this.y = v.y;
}
/// <summary>Constructs a float2 vector from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(double v)
{
this.x = (float)v;
this.y = (float)v;
}
/// <summary>Constructs a float2 vector from a double2 vector by componentwise conversion.</summary>
/// <param name="v">double2 to convert to float2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2(double2 v)
{
this.x = (float)v.x;
this.y = (float)v.y;
}
/// <summary>Implicitly converts a single float value to a float2 vector by assigning it to every component.</summary>
/// <param name="v">float to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2(float v) { return new float2(v); }
/// <summary>Explicitly converts a single bool value to a float2 vector by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2(bool v) { return new float2(v); }
/// <summary>Explicitly converts a bool2 vector to a float2 vector by componentwise conversion.</summary>
/// <param name="v">bool2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2(bool2 v) { return new float2(v); }
/// <summary>Implicitly converts a single int value to a float2 vector by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2(int v) { return new float2(v); }
/// <summary>Implicitly converts a int2 vector to a float2 vector by componentwise conversion.</summary>
/// <param name="v">int2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2(int2 v) { return new float2(v); }
/// <summary>Implicitly converts a single uint value to a float2 vector by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2(uint v) { return new float2(v); }
/// <summary>Implicitly converts a uint2 vector to a float2 vector by componentwise conversion.</summary>
/// <param name="v">uint2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2(uint2 v) { return new float2(v); }
/// <summary>Implicitly converts a single half value to a float2 vector by converting it to float and assigning it to every component.</summary>
/// <param name="v">half to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2(half v) { return new float2(v); }
/// <summary>Implicitly converts a half2 vector to a float2 vector by componentwise conversion.</summary>
/// <param name="v">half2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2(half2 v) { return new float2(v); }
/// <summary>Explicitly converts a single double value to a float2 vector by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2(double v) { return new float2(v); }
/// <summary>Explicitly converts a double2 vector to a float2 vector by componentwise conversion.</summary>
/// <param name="v">double2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2(double2 v) { return new float2(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise multiplication.</param>
/// <returns>float2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator * (float2 lhs, float2 rhs) { return new float2 (lhs.x * rhs.x, lhs.y * rhs.y); }
/// <summary>Returns the result of a componentwise multiplication operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator * (float2 lhs, float rhs) { return new float2 (lhs.x * rhs, lhs.y * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise multiplication.</param>
/// <returns>float2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator * (float lhs, float2 rhs) { return new float2 (lhs * rhs.x, lhs * rhs.y); }
/// <summary>Returns the result of a componentwise addition operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise addition.</param>
/// <returns>float2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator + (float2 lhs, float2 rhs) { return new float2 (lhs.x + rhs.x, lhs.y + rhs.y); }
/// <summary>Returns the result of a componentwise addition operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator + (float2 lhs, float rhs) { return new float2 (lhs.x + rhs, lhs.y + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise addition.</param>
/// <returns>float2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator + (float lhs, float2 rhs) { return new float2 (lhs + rhs.x, lhs + rhs.y); }
/// <summary>Returns the result of a componentwise subtraction operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise subtraction.</param>
/// <returns>float2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator - (float2 lhs, float2 rhs) { return new float2 (lhs.x - rhs.x, lhs.y - rhs.y); }
/// <summary>Returns the result of a componentwise subtraction operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator - (float2 lhs, float rhs) { return new float2 (lhs.x - rhs, lhs.y - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise subtraction.</param>
/// <returns>float2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator - (float lhs, float2 rhs) { return new float2 (lhs - rhs.x, lhs - rhs.y); }
/// <summary>Returns the result of a componentwise division operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise division.</param>
/// <returns>float2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator / (float2 lhs, float2 rhs) { return new float2 (lhs.x / rhs.x, lhs.y / rhs.y); }
/// <summary>Returns the result of a componentwise division operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator / (float2 lhs, float rhs) { return new float2 (lhs.x / rhs, lhs.y / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise division.</param>
/// <returns>float2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator / (float lhs, float2 rhs) { return new float2 (lhs / rhs.x, lhs / rhs.y); }
/// <summary>Returns the result of a componentwise modulus operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise modulus.</param>
/// <returns>float2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator % (float2 lhs, float2 rhs) { return new float2 (lhs.x % rhs.x, lhs.y % rhs.y); }
/// <summary>Returns the result of a componentwise modulus operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator % (float2 lhs, float rhs) { return new float2 (lhs.x % rhs, lhs.y % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise modulus.</param>
/// <returns>float2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator % (float lhs, float2 rhs) { return new float2 (lhs % rhs.x, lhs % rhs.y); }
/// <summary>Returns the result of a componentwise increment operation on a float2 vector.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float2 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator ++ (float2 val) { return new float2 (++val.x, ++val.y); }
/// <summary>Returns the result of a componentwise decrement operation on a float2 vector.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float2 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator -- (float2 val) { return new float2 (--val.x, --val.y); }
/// <summary>Returns the result of a componentwise less than operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise less than.</param>
/// <returns>bool2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator < (float2 lhs, float2 rhs) { return new bool2 (lhs.x < rhs.x, lhs.y < rhs.y); }
/// <summary>Returns the result of a componentwise less than operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator < (float2 lhs, float rhs) { return new bool2 (lhs.x < rhs, lhs.y < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise less than.</param>
/// <returns>bool2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator < (float lhs, float2 rhs) { return new bool2 (lhs < rhs.x, lhs < rhs.y); }
/// <summary>Returns the result of a componentwise less or equal operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise less or equal.</param>
/// <returns>bool2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator <= (float2 lhs, float2 rhs) { return new bool2 (lhs.x <= rhs.x, lhs.y <= rhs.y); }
/// <summary>Returns the result of a componentwise less or equal operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator <= (float2 lhs, float rhs) { return new bool2 (lhs.x <= rhs, lhs.y <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise less or equal.</param>
/// <returns>bool2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator <= (float lhs, float2 rhs) { return new bool2 (lhs <= rhs.x, lhs <= rhs.y); }
/// <summary>Returns the result of a componentwise greater than operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise greater than.</param>
/// <returns>bool2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator > (float2 lhs, float2 rhs) { return new bool2 (lhs.x > rhs.x, lhs.y > rhs.y); }
/// <summary>Returns the result of a componentwise greater than operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator > (float2 lhs, float rhs) { return new bool2 (lhs.x > rhs, lhs.y > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise greater than.</param>
/// <returns>bool2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator > (float lhs, float2 rhs) { return new bool2 (lhs > rhs.x, lhs > rhs.y); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator >= (float2 lhs, float2 rhs) { return new bool2 (lhs.x >= rhs.x, lhs.y >= rhs.y); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator >= (float2 lhs, float rhs) { return new bool2 (lhs.x >= rhs, lhs.y >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator >= (float lhs, float2 rhs) { return new bool2 (lhs >= rhs.x, lhs >= rhs.y); }
/// <summary>Returns the result of a componentwise unary minus operation on a float2 vector.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float2 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator - (float2 val) { return new float2 (-val.x, -val.y); }
/// <summary>Returns the result of a componentwise unary plus operation on a float2 vector.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float2 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 operator + (float2 val) { return new float2 (+val.x, +val.y); }
/// <summary>Returns the result of a componentwise equality operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (float2 lhs, float2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); }
/// <summary>Returns the result of a componentwise equality operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (float2 lhs, float rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (float lhs, float2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); }
/// <summary>Returns the result of a componentwise not equal operation on two float2 vectors.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (float2 lhs, float2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); }
/// <summary>Returns the result of a componentwise not equal operation on a float2 vector and a float value.</summary>
/// <param name="lhs">Left hand side float2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (float2 lhs, float rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float2 vector.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float2 to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (float lhs, float2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); }
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 xxxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(x, x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 xxxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(x, x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 xxyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(x, x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 xxyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(x, x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 xyxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(x, y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 xyxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(x, y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 xyyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(x, y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 xyyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(x, y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 yxxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(y, x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 yxxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(y, x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 yxyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(y, x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 yxyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(y, x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 yyxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(y, y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 yyxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(y, y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 yyyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(y, y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float4 yyyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float4(y, y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float3 xxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float3(x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float3 xxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float3(x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float3 xyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float3(x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float3 xyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float3(x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float3 yxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float3(y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float3 yxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float3(y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float3 yyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float3(y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float3 yyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float3(y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float2 xx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float2(x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float2 xy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float2(x, y); }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
set { x = value.x; y = value.y; }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float2 yx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float2(y, x); }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
set { y = value.x; x = value.y; }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public float2 yy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new float2(y, y); }
}
/// <summary>Returns the float element at a specified index.</summary>
unsafe public float this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (float2* array = &this) { return ((float*)array)[index]; }
}
set
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (float* array = &x) { array[index] = value; }
}
}
/// <summary>Returns true if the float2 is equal to a given float2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float2 rhs) { return x == rhs.x && y == rhs.y; }
/// <summary>Returns true if the float2 is equal to a given float2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float2 converted && Equals(converted); }
/// <summary>Returns a hash code for the float2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float2({0}f, {1}f)", x, y);
}
/// <summary>Returns a string representation of the float2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float2({0}f, {1}f)", x.ToString(format, formatProvider), y.ToString(format, formatProvider));
}
internal sealed class DebuggerProxy
{
public float x;
public float y;
public DebuggerProxy(float2 v)
{
x = v.x;
y = v.y;
}
}
}
public static partial class math
{
/// <summary>Returns a float2 vector constructed from two float values.</summary>
/// <param name="x">The constructed vector's x component will be set to this value.</param>
/// <param name="y">The constructed vector's y component will be set to this value.</param>
/// <returns>float2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(float x, float y) { return new float2(x, y); }
/// <summary>Returns a float2 vector constructed from a float2 vector.</summary>
/// <param name="xy">The constructed vector's xy components will be set to this value.</param>
/// <returns>float2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(float2 xy) { return new float2(xy); }
/// <summary>Returns a float2 vector constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(float v) { return new float2(v); }
/// <summary>Returns a float2 vector constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(bool v) { return new float2(v); }
/// <summary>Return a float2 vector constructed from a bool2 vector by componentwise conversion.</summary>
/// <param name="v">bool2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(bool2 v) { return new float2(v); }
/// <summary>Returns a float2 vector constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(int v) { return new float2(v); }
/// <summary>Return a float2 vector constructed from a int2 vector by componentwise conversion.</summary>
/// <param name="v">int2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(int2 v) { return new float2(v); }
/// <summary>Returns a float2 vector constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(uint v) { return new float2(v); }
/// <summary>Return a float2 vector constructed from a uint2 vector by componentwise conversion.</summary>
/// <param name="v">uint2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(uint2 v) { return new float2(v); }
/// <summary>Returns a float2 vector constructed from a single half value by converting it to float and assigning it to every component.</summary>
/// <param name="v">half to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(half v) { return new float2(v); }
/// <summary>Return a float2 vector constructed from a half2 vector by componentwise conversion.</summary>
/// <param name="v">half2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(half2 v) { return new float2(v); }
/// <summary>Returns a float2 vector constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(double v) { return new float2(v); }
/// <summary>Return a float2 vector constructed from a double2 vector by componentwise conversion.</summary>
/// <param name="v">double2 to convert to float2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 float2(double2 v) { return new float2(v); }
/// <summary>Returns a uint hash code of a float2 vector.</summary>
/// <param name="v">Vector value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float2 v)
{
return csum(asuint(v) * uint2(0xFA3A3285u, 0xAD55999Du)) + 0xDCDD5341u;
}
/// <summary>
/// Returns a uint2 vector hash code of a float2 vector.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Vector value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(float2 v)
{
return (asuint(v) * uint2(0x94DDD769u, 0xA1E92D39u)) + 0x4583C801u;
}
/// <summary>Returns the result of specified shuffling of the components from two float2 vectors into a float value.</summary>
/// <param name="left">float2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">float2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting float.</param>
/// <returns>float result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float shuffle(float2 left, float2 right, ShuffleComponent x)
{
return select_shuffle_component(left, right, x);
}
/// <summary>Returns the result of specified shuffling of the components from two float2 vectors into a float2 vector.</summary>
/// <param name="left">float2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">float2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting float2 x component.</param>
/// <param name="y">The ShuffleComponent to use when setting the resulting float2 y component.</param>
/// <returns>float2 result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2 shuffle(float2 left, float2 right, ShuffleComponent x, ShuffleComponent y)
{
return float2(
select_shuffle_component(left, right, x),
select_shuffle_component(left, right, y));
}
/// <summary>Returns the result of specified shuffling of the components from two float2 vectors into a float3 vector.</summary>
/// <param name="left">float2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">float2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting float3 x component.</param>
/// <param name="y">The ShuffleComponent to use when setting the resulting float3 y component.</param>
/// <param name="z">The ShuffleComponent to use when setting the resulting float3 z component.</param>
/// <returns>float3 result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3 shuffle(float2 left, float2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
{
return float3(
select_shuffle_component(left, right, x),
select_shuffle_component(left, right, y),
select_shuffle_component(left, right, z));
}
/// <summary>Returns the result of specified shuffling of the components from two float2 vectors into a float4 vector.</summary>
/// <param name="left">float2 to use as the left argument of the shuffle operation.</param>
/// <param name="right">float2 to use as the right argument of the shuffle operation.</param>
/// <param name="x">The ShuffleComponent to use when setting the resulting float4 x component.</param>
/// <param name="y">The ShuffleComponent to use when setting the resulting float4 y component.</param>
/// <param name="z">The ShuffleComponent to use when setting the resulting float4 z component.</param>
/// <param name="w">The ShuffleComponent to use when setting the resulting float4 w component.</param>
/// <returns>float4 result of the shuffle operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4 shuffle(float2 left, float2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
{
return float4(
select_shuffle_component(left, right, x),
select_shuffle_component(left, right, y),
select_shuffle_component(left, right, z),
select_shuffle_component(left, right, w));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static float select_shuffle_component(float2 a, float2 b, ShuffleComponent component)
{
switch(component)
{
case ShuffleComponent.LeftX:
return a.x;
case ShuffleComponent.LeftY:
return a.y;
case ShuffleComponent.RightX:
return b.x;
case ShuffleComponent.RightY:
return b.y;
default:
throw new System.ArgumentException("Invalid shuffle component: " + component);
}
}
}
}

View File

@@ -0,0 +1,658 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x2 matrix of floats.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float2x2 : System.IEquatable<float2x2>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public float2 c0;
/// <summary>Column 1 of the matrix.</summary>
public float2 c1;
/// <summary>float2x2 identity transform.</summary>
public static readonly float2x2 identity = new float2x2(1.0f, 0.0f, 0.0f, 1.0f);
/// <summary>float2x2 zero value.</summary>
public static readonly float2x2 zero;
/// <summary>Constructs a float2x2 matrix from two float2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(float2 c0, float2 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a float2x2 matrix from 4 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(float m00, float m01,
float m10, float m11)
{
this.c0 = new float2(m00, m10);
this.c1 = new float2(m01, m11);
}
/// <summary>Constructs a float2x2 matrix from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(float v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a float2x2 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(bool v)
{
this.c0 = math.select(new float2(0.0f), new float2(1.0f), v);
this.c1 = math.select(new float2(0.0f), new float2(1.0f), v);
}
/// <summary>Constructs a float2x2 matrix from a bool2x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x2 to convert to float2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(bool2x2 v)
{
this.c0 = math.select(new float2(0.0f), new float2(1.0f), v.c0);
this.c1 = math.select(new float2(0.0f), new float2(1.0f), v.c1);
}
/// <summary>Constructs a float2x2 matrix from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(int v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a float2x2 matrix from a int2x2 matrix by componentwise conversion.</summary>
/// <param name="v">int2x2 to convert to float2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(int2x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a float2x2 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(uint v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a float2x2 matrix from a uint2x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x2 to convert to float2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(uint2x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a float2x2 matrix from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(double v)
{
this.c0 = (float2)v;
this.c1 = (float2)v;
}
/// <summary>Constructs a float2x2 matrix from a double2x2 matrix by componentwise conversion.</summary>
/// <param name="v">double2x2 to convert to float2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x2(double2x2 v)
{
this.c0 = (float2)v.c0;
this.c1 = (float2)v.c1;
}
/// <summary>Implicitly converts a single float value to a float2x2 matrix by assigning it to every component.</summary>
/// <param name="v">float to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x2(float v) { return new float2x2(v); }
/// <summary>Explicitly converts a single bool value to a float2x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x2(bool v) { return new float2x2(v); }
/// <summary>Explicitly converts a bool2x2 matrix to a float2x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x2 to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x2(bool2x2 v) { return new float2x2(v); }
/// <summary>Implicitly converts a single int value to a float2x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x2(int v) { return new float2x2(v); }
/// <summary>Implicitly converts a int2x2 matrix to a float2x2 matrix by componentwise conversion.</summary>
/// <param name="v">int2x2 to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x2(int2x2 v) { return new float2x2(v); }
/// <summary>Implicitly converts a single uint value to a float2x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x2(uint v) { return new float2x2(v); }
/// <summary>Implicitly converts a uint2x2 matrix to a float2x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x2 to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x2(uint2x2 v) { return new float2x2(v); }
/// <summary>Explicitly converts a single double value to a float2x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x2(double v) { return new float2x2(v); }
/// <summary>Explicitly converts a double2x2 matrix to a float2x2 matrix by componentwise conversion.</summary>
/// <param name="v">double2x2 to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x2(double2x2 v) { return new float2x2(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise multiplication.</param>
/// <returns>float2x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator * (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
/// <summary>Returns the result of a componentwise multiplication operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float2x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator * (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise multiplication.</param>
/// <returns>float2x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator * (float lhs, float2x2 rhs) { return new float2x2 (lhs * rhs.c0, lhs * rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise addition.</param>
/// <returns>float2x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator + (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float2x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator + (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise addition.</param>
/// <returns>float2x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator + (float lhs, float2x2 rhs) { return new float2x2 (lhs + rhs.c0, lhs + rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise subtraction.</param>
/// <returns>float2x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator - (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float2x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator - (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise subtraction.</param>
/// <returns>float2x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator - (float lhs, float2x2 rhs) { return new float2x2 (lhs - rhs.c0, lhs - rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise division.</param>
/// <returns>float2x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator / (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float2x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator / (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise division.</param>
/// <returns>float2x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator / (float lhs, float2x2 rhs) { return new float2x2 (lhs / rhs.c0, lhs / rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise modulus.</param>
/// <returns>float2x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator % (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float2x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator % (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise modulus.</param>
/// <returns>float2x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator % (float lhs, float2x2 rhs) { return new float2x2 (lhs % rhs.c0, lhs % rhs.c1); }
/// <summary>Returns the result of a componentwise increment operation on a float2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float2x2 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator ++ (float2x2 val) { return new float2x2 (++val.c0, ++val.c1); }
/// <summary>Returns the result of a componentwise decrement operation on a float2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float2x2 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator -- (float2x2 val) { return new float2x2 (--val.c0, --val.c1); }
/// <summary>Returns the result of a componentwise less than operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise less than.</param>
/// <returns>bool2x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator < (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
/// <summary>Returns the result of a componentwise less than operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool2x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator < (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise less than.</param>
/// <returns>bool2x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator < (float lhs, float2x2 rhs) { return new bool2x2 (lhs < rhs.c0, lhs < rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise less or equal.</param>
/// <returns>bool2x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator <= (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool2x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator <= (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise less or equal.</param>
/// <returns>bool2x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator <= (float lhs, float2x2 rhs) { return new bool2x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise greater than.</param>
/// <returns>bool2x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator > (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool2x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator > (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise greater than.</param>
/// <returns>bool2x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator > (float lhs, float2x2 rhs) { return new bool2x2 (lhs > rhs.c0, lhs > rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator >= (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool2x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator >= (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator >= (float lhs, float2x2 rhs) { return new bool2x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
/// <summary>Returns the result of a componentwise unary minus operation on a float2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float2x2 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator - (float2x2 val) { return new float2x2 (-val.c0, -val.c1); }
/// <summary>Returns the result of a componentwise unary plus operation on a float2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float2x2 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 operator + (float2x2 val) { return new float2x2 (+val.c0, +val.c1); }
/// <summary>Returns the result of a componentwise equality operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (float lhs, float2x2 rhs) { return new bool2x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two float2x2 matrices.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on a float2x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float2x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float2x2 to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (float lhs, float2x2 rhs) { return new bool2x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the float2 element at a specified index.</summary>
unsafe public ref float2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (float2x2* array = &this) { return ref ((float2*)array)[index]; }
}
}
/// <summary>Returns true if the float2x2 is equal to a given float2x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float2x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the float2x2 is equal to a given float2x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float2x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the float2x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float2x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float2x2({0}f, {1}f, {2}f, {3}f)", c0.x, c1.x, c0.y, c1.y);
}
/// <summary>Returns a string representation of the float2x2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float2x2({0}f, {1}f, {2}f, {3}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a float2x2 matrix constructed from two float2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>float2x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(float2 c0, float2 c1) { return new float2x2(c0, c1); }
/// <summary>Returns a float2x2 matrix constructed from from 4 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <returns>float2x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(float m00, float m01,
float m10, float m11)
{
return new float2x2(m00, m01,
m10, m11);
}
/// <summary>Returns a float2x2 matrix constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(float v) { return new float2x2(v); }
/// <summary>Returns a float2x2 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(bool v) { return new float2x2(v); }
/// <summary>Return a float2x2 matrix constructed from a bool2x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x2 to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(bool2x2 v) { return new float2x2(v); }
/// <summary>Returns a float2x2 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(int v) { return new float2x2(v); }
/// <summary>Return a float2x2 matrix constructed from a int2x2 matrix by componentwise conversion.</summary>
/// <param name="v">int2x2 to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(int2x2 v) { return new float2x2(v); }
/// <summary>Returns a float2x2 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(uint v) { return new float2x2(v); }
/// <summary>Return a float2x2 matrix constructed from a uint2x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x2 to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(uint2x2 v) { return new float2x2(v); }
/// <summary>Returns a float2x2 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(double v) { return new float2x2(v); }
/// <summary>Return a float2x2 matrix constructed from a double2x2 matrix by componentwise conversion.</summary>
/// <param name="v">double2x2 to convert to float2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 float2x2(double2x2 v) { return new float2x2(v); }
/// <summary>Return the float2x2 transpose of a float2x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 transpose(float2x2 v)
{
return float2x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y);
}
/// <summary>Returns the float2x2 full inverse of a float2x2 matrix.</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x2 inverse(float2x2 m)
{
float a = m.c0.x;
float b = m.c1.x;
float c = m.c0.y;
float d = m.c1.y;
float det = a * d - b * c;
return float2x2(d, -b, -c, a) * (1.0f / det);
}
/// <summary>Returns the determinant of a float2x2 matrix.</summary>
/// <param name="m">Matrix to use when computing determinant.</param>
/// <returns>The determinant of the matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float determinant(float2x2 m)
{
float a = m.c0.x;
float b = m.c1.x;
float c = m.c0.y;
float d = m.c1.y;
return a * d - b * c;
}
/// <summary>Returns a uint hash code of a float2x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float2x2 v)
{
return csum(asuint(v.c0) * uint2(0x9C9F0823u, 0x5A9CA13Bu) +
asuint(v.c1) * uint2(0xAFCDD5EFu, 0xA88D187Du)) + 0xCF6EBA1Du;
}
/// <summary>
/// Returns a uint2 vector hash code of a float2x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(float2x2 v)
{
return (asuint(v.c0) * uint2(0x9D88E5A1u, 0xEADF0775u) +
asuint(v.c1) * uint2(0x747A9D7Bu, 0x4111F799u)) + 0xB5F05AF1u;
}
}
}

View File

@@ -0,0 +1,647 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x3 matrix of floats.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float2x3 : System.IEquatable<float2x3>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public float2 c0;
/// <summary>Column 1 of the matrix.</summary>
public float2 c1;
/// <summary>Column 2 of the matrix.</summary>
public float2 c2;
/// <summary>float2x3 zero value.</summary>
public static readonly float2x3 zero;
/// <summary>Constructs a float2x3 matrix from three float2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(float2 c0, float2 c1, float2 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a float2x3 matrix from 6 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(float m00, float m01, float m02,
float m10, float m11, float m12)
{
this.c0 = new float2(m00, m10);
this.c1 = new float2(m01, m11);
this.c2 = new float2(m02, m12);
}
/// <summary>Constructs a float2x3 matrix from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a float2x3 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(bool v)
{
this.c0 = math.select(new float2(0.0f), new float2(1.0f), v);
this.c1 = math.select(new float2(0.0f), new float2(1.0f), v);
this.c2 = math.select(new float2(0.0f), new float2(1.0f), v);
}
/// <summary>Constructs a float2x3 matrix from a bool2x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x3 to convert to float2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(bool2x3 v)
{
this.c0 = math.select(new float2(0.0f), new float2(1.0f), v.c0);
this.c1 = math.select(new float2(0.0f), new float2(1.0f), v.c1);
this.c2 = math.select(new float2(0.0f), new float2(1.0f), v.c2);
}
/// <summary>Constructs a float2x3 matrix from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a float2x3 matrix from a int2x3 matrix by componentwise conversion.</summary>
/// <param name="v">int2x3 to convert to float2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(int2x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a float2x3 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a float2x3 matrix from a uint2x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x3 to convert to float2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(uint2x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a float2x3 matrix from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(double v)
{
this.c0 = (float2)v;
this.c1 = (float2)v;
this.c2 = (float2)v;
}
/// <summary>Constructs a float2x3 matrix from a double2x3 matrix by componentwise conversion.</summary>
/// <param name="v">double2x3 to convert to float2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x3(double2x3 v)
{
this.c0 = (float2)v.c0;
this.c1 = (float2)v.c1;
this.c2 = (float2)v.c2;
}
/// <summary>Implicitly converts a single float value to a float2x3 matrix by assigning it to every component.</summary>
/// <param name="v">float to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x3(float v) { return new float2x3(v); }
/// <summary>Explicitly converts a single bool value to a float2x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x3(bool v) { return new float2x3(v); }
/// <summary>Explicitly converts a bool2x3 matrix to a float2x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x3 to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x3(bool2x3 v) { return new float2x3(v); }
/// <summary>Implicitly converts a single int value to a float2x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x3(int v) { return new float2x3(v); }
/// <summary>Implicitly converts a int2x3 matrix to a float2x3 matrix by componentwise conversion.</summary>
/// <param name="v">int2x3 to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x3(int2x3 v) { return new float2x3(v); }
/// <summary>Implicitly converts a single uint value to a float2x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x3(uint v) { return new float2x3(v); }
/// <summary>Implicitly converts a uint2x3 matrix to a float2x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x3 to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x3(uint2x3 v) { return new float2x3(v); }
/// <summary>Explicitly converts a single double value to a float2x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x3(double v) { return new float2x3(v); }
/// <summary>Explicitly converts a double2x3 matrix to a float2x3 matrix by componentwise conversion.</summary>
/// <param name="v">double2x3 to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x3(double2x3 v) { return new float2x3(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise multiplication.</param>
/// <returns>float2x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator * (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); }
/// <summary>Returns the result of a componentwise multiplication operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float2x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator * (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise multiplication.</param>
/// <returns>float2x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator * (float lhs, float2x3 rhs) { return new float2x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise addition.</param>
/// <returns>float2x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator + (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float2x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator + (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise addition.</param>
/// <returns>float2x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator + (float lhs, float2x3 rhs) { return new float2x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise subtraction.</param>
/// <returns>float2x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator - (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float2x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator - (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise subtraction.</param>
/// <returns>float2x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator - (float lhs, float2x3 rhs) { return new float2x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise division.</param>
/// <returns>float2x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator / (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float2x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator / (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise division.</param>
/// <returns>float2x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator / (float lhs, float2x3 rhs) { return new float2x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise modulus.</param>
/// <returns>float2x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator % (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float2x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator % (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise modulus.</param>
/// <returns>float2x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator % (float lhs, float2x3 rhs) { return new float2x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); }
/// <summary>Returns the result of a componentwise increment operation on a float2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float2x3 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator ++ (float2x3 val) { return new float2x3 (++val.c0, ++val.c1, ++val.c2); }
/// <summary>Returns the result of a componentwise decrement operation on a float2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float2x3 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator -- (float2x3 val) { return new float2x3 (--val.c0, --val.c1, --val.c2); }
/// <summary>Returns the result of a componentwise less than operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise less than.</param>
/// <returns>bool2x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator < (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); }
/// <summary>Returns the result of a componentwise less than operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool2x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator < (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise less than.</param>
/// <returns>bool2x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator < (float lhs, float2x3 rhs) { return new bool2x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise less or equal.</param>
/// <returns>bool2x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator <= (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool2x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator <= (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise less or equal.</param>
/// <returns>bool2x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator <= (float lhs, float2x3 rhs) { return new bool2x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise greater than.</param>
/// <returns>bool2x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator > (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool2x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator > (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise greater than.</param>
/// <returns>bool2x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator > (float lhs, float2x3 rhs) { return new bool2x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator >= (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool2x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator >= (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator >= (float lhs, float2x3 rhs) { return new bool2x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); }
/// <summary>Returns the result of a componentwise unary minus operation on a float2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float2x3 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator - (float2x3 val) { return new float2x3 (-val.c0, -val.c1, -val.c2); }
/// <summary>Returns the result of a componentwise unary plus operation on a float2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float2x3 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 operator + (float2x3 val) { return new float2x3 (+val.c0, +val.c1, +val.c2); }
/// <summary>Returns the result of a componentwise equality operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (float lhs, float2x3 rhs) { return new bool2x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two float2x3 matrices.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on a float2x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float2x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float2x3 to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (float lhs, float2x3 rhs) { return new bool2x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the float2 element at a specified index.</summary>
unsafe public ref float2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (float2x3* array = &this) { return ref ((float2*)array)[index]; }
}
}
/// <summary>Returns true if the float2x3 is equal to a given float2x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float2x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the float2x3 is equal to a given float2x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float2x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the float2x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float2x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float2x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y);
}
/// <summary>Returns a string representation of the float2x3 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float2x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a float2x3 matrix constructed from three float2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>float2x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(float2 c0, float2 c1, float2 c2) { return new float2x3(c0, c1, c2); }
/// <summary>Returns a float2x3 matrix constructed from from 6 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <returns>float2x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(float m00, float m01, float m02,
float m10, float m11, float m12)
{
return new float2x3(m00, m01, m02,
m10, m11, m12);
}
/// <summary>Returns a float2x3 matrix constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(float v) { return new float2x3(v); }
/// <summary>Returns a float2x3 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(bool v) { return new float2x3(v); }
/// <summary>Return a float2x3 matrix constructed from a bool2x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x3 to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(bool2x3 v) { return new float2x3(v); }
/// <summary>Returns a float2x3 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(int v) { return new float2x3(v); }
/// <summary>Return a float2x3 matrix constructed from a int2x3 matrix by componentwise conversion.</summary>
/// <param name="v">int2x3 to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(int2x3 v) { return new float2x3(v); }
/// <summary>Returns a float2x3 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(uint v) { return new float2x3(v); }
/// <summary>Return a float2x3 matrix constructed from a uint2x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x3 to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(uint2x3 v) { return new float2x3(v); }
/// <summary>Returns a float2x3 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(double v) { return new float2x3(v); }
/// <summary>Return a float2x3 matrix constructed from a double2x3 matrix by componentwise conversion.</summary>
/// <param name="v">double2x3 to convert to float2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 float2x3(double2x3 v) { return new float2x3(v); }
/// <summary>Return the float3x2 transpose of a float2x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 transpose(float2x3 v)
{
return float3x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y,
v.c2.x, v.c2.y);
}
/// <summary>Returns a uint hash code of a float2x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float2x3 v)
{
return csum(asuint(v.c0) * uint2(0xE857DCE1u, 0xF62213C5u) +
asuint(v.c1) * uint2(0x9CDAA959u, 0xAA269ABFu) +
asuint(v.c2) * uint2(0xD54BA36Fu, 0xFD0847B9u)) + 0x8189A683u;
}
/// <summary>
/// Returns a uint2 vector hash code of a float2x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(float2x3 v)
{
return (asuint(v.c0) * uint2(0xB139D651u, 0xE7579997u) +
asuint(v.c1) * uint2(0xEF7D56C7u, 0x66F38F0Bu) +
asuint(v.c2) * uint2(0x624256A3u, 0x5292ADE1u)) + 0xD2E590E5u;
}
}
}

View File

@@ -0,0 +1,669 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x4 matrix of floats.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float2x4 : System.IEquatable<float2x4>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public float2 c0;
/// <summary>Column 1 of the matrix.</summary>
public float2 c1;
/// <summary>Column 2 of the matrix.</summary>
public float2 c2;
/// <summary>Column 3 of the matrix.</summary>
public float2 c3;
/// <summary>float2x4 zero value.</summary>
public static readonly float2x4 zero;
/// <summary>Constructs a float2x4 matrix from four float2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(float2 c0, float2 c1, float2 c2, float2 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a float2x4 matrix from 8 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13)
{
this.c0 = new float2(m00, m10);
this.c1 = new float2(m01, m11);
this.c2 = new float2(m02, m12);
this.c3 = new float2(m03, m13);
}
/// <summary>Constructs a float2x4 matrix from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a float2x4 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(bool v)
{
this.c0 = math.select(new float2(0.0f), new float2(1.0f), v);
this.c1 = math.select(new float2(0.0f), new float2(1.0f), v);
this.c2 = math.select(new float2(0.0f), new float2(1.0f), v);
this.c3 = math.select(new float2(0.0f), new float2(1.0f), v);
}
/// <summary>Constructs a float2x4 matrix from a bool2x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x4 to convert to float2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(bool2x4 v)
{
this.c0 = math.select(new float2(0.0f), new float2(1.0f), v.c0);
this.c1 = math.select(new float2(0.0f), new float2(1.0f), v.c1);
this.c2 = math.select(new float2(0.0f), new float2(1.0f), v.c2);
this.c3 = math.select(new float2(0.0f), new float2(1.0f), v.c3);
}
/// <summary>Constructs a float2x4 matrix from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a float2x4 matrix from a int2x4 matrix by componentwise conversion.</summary>
/// <param name="v">int2x4 to convert to float2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(int2x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a float2x4 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a float2x4 matrix from a uint2x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x4 to convert to float2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(uint2x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a float2x4 matrix from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(double v)
{
this.c0 = (float2)v;
this.c1 = (float2)v;
this.c2 = (float2)v;
this.c3 = (float2)v;
}
/// <summary>Constructs a float2x4 matrix from a double2x4 matrix by componentwise conversion.</summary>
/// <param name="v">double2x4 to convert to float2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float2x4(double2x4 v)
{
this.c0 = (float2)v.c0;
this.c1 = (float2)v.c1;
this.c2 = (float2)v.c2;
this.c3 = (float2)v.c3;
}
/// <summary>Implicitly converts a single float value to a float2x4 matrix by assigning it to every component.</summary>
/// <param name="v">float to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x4(float v) { return new float2x4(v); }
/// <summary>Explicitly converts a single bool value to a float2x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x4(bool v) { return new float2x4(v); }
/// <summary>Explicitly converts a bool2x4 matrix to a float2x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x4 to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x4(bool2x4 v) { return new float2x4(v); }
/// <summary>Implicitly converts a single int value to a float2x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x4(int v) { return new float2x4(v); }
/// <summary>Implicitly converts a int2x4 matrix to a float2x4 matrix by componentwise conversion.</summary>
/// <param name="v">int2x4 to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x4(int2x4 v) { return new float2x4(v); }
/// <summary>Implicitly converts a single uint value to a float2x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x4(uint v) { return new float2x4(v); }
/// <summary>Implicitly converts a uint2x4 matrix to a float2x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x4 to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float2x4(uint2x4 v) { return new float2x4(v); }
/// <summary>Explicitly converts a single double value to a float2x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x4(double v) { return new float2x4(v); }
/// <summary>Explicitly converts a double2x4 matrix to a float2x4 matrix by componentwise conversion.</summary>
/// <param name="v">double2x4 to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float2x4(double2x4 v) { return new float2x4(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise multiplication.</param>
/// <returns>float2x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator * (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
/// <summary>Returns the result of a componentwise multiplication operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float2x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator * (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise multiplication.</param>
/// <returns>float2x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator * (float lhs, float2x4 rhs) { return new float2x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise addition.</param>
/// <returns>float2x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator + (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float2x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator + (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise addition.</param>
/// <returns>float2x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator + (float lhs, float2x4 rhs) { return new float2x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise subtraction.</param>
/// <returns>float2x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator - (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float2x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator - (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise subtraction.</param>
/// <returns>float2x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator - (float lhs, float2x4 rhs) { return new float2x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise division.</param>
/// <returns>float2x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator / (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float2x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator / (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise division.</param>
/// <returns>float2x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator / (float lhs, float2x4 rhs) { return new float2x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise modulus.</param>
/// <returns>float2x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator % (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float2x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator % (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise modulus.</param>
/// <returns>float2x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator % (float lhs, float2x4 rhs) { return new float2x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
/// <summary>Returns the result of a componentwise increment operation on a float2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float2x4 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator ++ (float2x4 val) { return new float2x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
/// <summary>Returns the result of a componentwise decrement operation on a float2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float2x4 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator -- (float2x4 val) { return new float2x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
/// <summary>Returns the result of a componentwise less than operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise less than.</param>
/// <returns>bool2x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator < (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
/// <summary>Returns the result of a componentwise less than operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool2x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator < (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise less than.</param>
/// <returns>bool2x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator < (float lhs, float2x4 rhs) { return new bool2x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise less or equal.</param>
/// <returns>bool2x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator <= (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool2x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator <= (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise less or equal.</param>
/// <returns>bool2x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator <= (float lhs, float2x4 rhs) { return new bool2x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise greater than.</param>
/// <returns>bool2x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator > (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool2x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator > (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise greater than.</param>
/// <returns>bool2x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator > (float lhs, float2x4 rhs) { return new bool2x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator >= (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool2x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator >= (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator >= (float lhs, float2x4 rhs) { return new bool2x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
/// <summary>Returns the result of a componentwise unary minus operation on a float2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float2x4 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator - (float2x4 val) { return new float2x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
/// <summary>Returns the result of a componentwise unary plus operation on a float2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float2x4 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 operator + (float2x4 val) { return new float2x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
/// <summary>Returns the result of a componentwise equality operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (float lhs, float2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two float2x4 matrices.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on a float2x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float2x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float2x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float2x4 to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (float lhs, float2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the float2 element at a specified index.</summary>
unsafe public ref float2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (float2x4* array = &this) { return ref ((float2*)array)[index]; }
}
}
/// <summary>Returns true if the float2x4 is equal to a given float2x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the float2x4 is equal to a given float2x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float2x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the float2x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float2x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float2x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f)", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y);
}
/// <summary>Returns a string representation of the float2x4 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float2x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a float2x4 matrix constructed from four float2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>float2x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(float2 c0, float2 c1, float2 c2, float2 c3) { return new float2x4(c0, c1, c2, c3); }
/// <summary>Returns a float2x4 matrix constructed from from 8 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <returns>float2x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13)
{
return new float2x4(m00, m01, m02, m03,
m10, m11, m12, m13);
}
/// <summary>Returns a float2x4 matrix constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(float v) { return new float2x4(v); }
/// <summary>Returns a float2x4 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(bool v) { return new float2x4(v); }
/// <summary>Return a float2x4 matrix constructed from a bool2x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x4 to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(bool2x4 v) { return new float2x4(v); }
/// <summary>Returns a float2x4 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(int v) { return new float2x4(v); }
/// <summary>Return a float2x4 matrix constructed from a int2x4 matrix by componentwise conversion.</summary>
/// <param name="v">int2x4 to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(int2x4 v) { return new float2x4(v); }
/// <summary>Returns a float2x4 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(uint v) { return new float2x4(v); }
/// <summary>Return a float2x4 matrix constructed from a uint2x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x4 to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(uint2x4 v) { return new float2x4(v); }
/// <summary>Returns a float2x4 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(double v) { return new float2x4(v); }
/// <summary>Return a float2x4 matrix constructed from a double2x4 matrix by componentwise conversion.</summary>
/// <param name="v">double2x4 to convert to float2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 float2x4(double2x4 v) { return new float2x4(v); }
/// <summary>Return the float4x2 transpose of a float2x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 transpose(float2x4 v)
{
return float4x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y,
v.c2.x, v.c2.y,
v.c3.x, v.c3.y);
}
/// <summary>Returns a uint hash code of a float2x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float2x4 v)
{
return csum(asuint(v.c0) * uint2(0xD35C9B2Du, 0xA10D9E27u) +
asuint(v.c1) * uint2(0x568DAAA9u, 0x7530254Fu) +
asuint(v.c2) * uint2(0x9F090439u, 0x5E9F85C9u) +
asuint(v.c3) * uint2(0x8C4CA03Fu, 0xB8D969EDu)) + 0xAC5DB57Bu;
}
/// <summary>
/// Returns a uint2 vector hash code of a float2x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(float2x4 v)
{
return (asuint(v.c0) * uint2(0xA91A02EDu, 0xB3C49313u) +
asuint(v.c1) * uint2(0xF43A9ABBu, 0x84E7E01Bu) +
asuint(v.c2) * uint2(0x8E055BE5u, 0x6E624EB7u) +
asuint(v.c3) * uint2(0x7383ED49u, 0xDD49C23Bu)) + 0xEBD0D005u;
}
}
}

1878
ThirdParty/Unity.Mathematics/float3.gen.cs vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,632 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 3x2 matrix of floats.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float3x2 : System.IEquatable<float3x2>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public float3 c0;
/// <summary>Column 1 of the matrix.</summary>
public float3 c1;
/// <summary>float3x2 zero value.</summary>
public static readonly float3x2 zero;
/// <summary>Constructs a float3x2 matrix from two float3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(float3 c0, float3 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a float3x2 matrix from 6 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(float m00, float m01,
float m10, float m11,
float m20, float m21)
{
this.c0 = new float3(m00, m10, m20);
this.c1 = new float3(m01, m11, m21);
}
/// <summary>Constructs a float3x2 matrix from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(float v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a float3x2 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(bool v)
{
this.c0 = math.select(new float3(0.0f), new float3(1.0f), v);
this.c1 = math.select(new float3(0.0f), new float3(1.0f), v);
}
/// <summary>Constructs a float3x2 matrix from a bool3x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x2 to convert to float3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(bool3x2 v)
{
this.c0 = math.select(new float3(0.0f), new float3(1.0f), v.c0);
this.c1 = math.select(new float3(0.0f), new float3(1.0f), v.c1);
}
/// <summary>Constructs a float3x2 matrix from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(int v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a float3x2 matrix from a int3x2 matrix by componentwise conversion.</summary>
/// <param name="v">int3x2 to convert to float3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(int3x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a float3x2 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(uint v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a float3x2 matrix from a uint3x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x2 to convert to float3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(uint3x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a float3x2 matrix from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(double v)
{
this.c0 = (float3)v;
this.c1 = (float3)v;
}
/// <summary>Constructs a float3x2 matrix from a double3x2 matrix by componentwise conversion.</summary>
/// <param name="v">double3x2 to convert to float3x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x2(double3x2 v)
{
this.c0 = (float3)v.c0;
this.c1 = (float3)v.c1;
}
/// <summary>Implicitly converts a single float value to a float3x2 matrix by assigning it to every component.</summary>
/// <param name="v">float to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x2(float v) { return new float3x2(v); }
/// <summary>Explicitly converts a single bool value to a float3x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x2(bool v) { return new float3x2(v); }
/// <summary>Explicitly converts a bool3x2 matrix to a float3x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x2 to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x2(bool3x2 v) { return new float3x2(v); }
/// <summary>Implicitly converts a single int value to a float3x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x2(int v) { return new float3x2(v); }
/// <summary>Implicitly converts a int3x2 matrix to a float3x2 matrix by componentwise conversion.</summary>
/// <param name="v">int3x2 to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x2(int3x2 v) { return new float3x2(v); }
/// <summary>Implicitly converts a single uint value to a float3x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x2(uint v) { return new float3x2(v); }
/// <summary>Implicitly converts a uint3x2 matrix to a float3x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x2 to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x2(uint3x2 v) { return new float3x2(v); }
/// <summary>Explicitly converts a single double value to a float3x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x2(double v) { return new float3x2(v); }
/// <summary>Explicitly converts a double3x2 matrix to a float3x2 matrix by componentwise conversion.</summary>
/// <param name="v">double3x2 to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x2(double3x2 v) { return new float3x2(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise multiplication.</param>
/// <returns>float3x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator * (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
/// <summary>Returns the result of a componentwise multiplication operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float3x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator * (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise multiplication.</param>
/// <returns>float3x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator * (float lhs, float3x2 rhs) { return new float3x2 (lhs * rhs.c0, lhs * rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise addition.</param>
/// <returns>float3x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator + (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float3x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator + (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise addition.</param>
/// <returns>float3x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator + (float lhs, float3x2 rhs) { return new float3x2 (lhs + rhs.c0, lhs + rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise subtraction.</param>
/// <returns>float3x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator - (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float3x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator - (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise subtraction.</param>
/// <returns>float3x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator - (float lhs, float3x2 rhs) { return new float3x2 (lhs - rhs.c0, lhs - rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise division.</param>
/// <returns>float3x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator / (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float3x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator / (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise division.</param>
/// <returns>float3x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator / (float lhs, float3x2 rhs) { return new float3x2 (lhs / rhs.c0, lhs / rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise modulus.</param>
/// <returns>float3x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator % (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float3x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator % (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise modulus.</param>
/// <returns>float3x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator % (float lhs, float3x2 rhs) { return new float3x2 (lhs % rhs.c0, lhs % rhs.c1); }
/// <summary>Returns the result of a componentwise increment operation on a float3x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float3x2 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator ++ (float3x2 val) { return new float3x2 (++val.c0, ++val.c1); }
/// <summary>Returns the result of a componentwise decrement operation on a float3x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float3x2 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator -- (float3x2 val) { return new float3x2 (--val.c0, --val.c1); }
/// <summary>Returns the result of a componentwise less than operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise less than.</param>
/// <returns>bool3x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator < (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
/// <summary>Returns the result of a componentwise less than operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool3x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator < (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise less than.</param>
/// <returns>bool3x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator < (float lhs, float3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise less or equal.</param>
/// <returns>bool3x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator <= (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool3x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator <= (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise less or equal.</param>
/// <returns>bool3x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator <= (float lhs, float3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise greater than.</param>
/// <returns>bool3x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator > (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool3x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator > (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise greater than.</param>
/// <returns>bool3x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator > (float lhs, float3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator >= (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool3x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator >= (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator >= (float lhs, float3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
/// <summary>Returns the result of a componentwise unary minus operation on a float3x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float3x2 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator - (float3x2 val) { return new float3x2 (-val.c0, -val.c1); }
/// <summary>Returns the result of a componentwise unary plus operation on a float3x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float3x2 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 operator + (float3x2 val) { return new float3x2 (+val.c0, +val.c1); }
/// <summary>Returns the result of a componentwise equality operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise equality.</param>
/// <returns>bool3x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator == (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool3x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator == (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise equality.</param>
/// <returns>bool3x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator == (float lhs, float3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two float3x2 matrices.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise not equal.</param>
/// <returns>bool3x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator != (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on a float3x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool3x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator != (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float3x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float3x2 to use to compute componentwise not equal.</param>
/// <returns>bool3x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x2 operator != (float lhs, float3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the float3 element at a specified index.</summary>
unsafe public ref float3 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (float3x2* array = &this) { return ref ((float3*)array)[index]; }
}
}
/// <summary>Returns true if the float3x2 is equal to a given float3x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the float3x2 is equal to a given float3x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float3x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the float3x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float3x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float3x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z);
}
/// <summary>Returns a string representation of the float3x2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float3x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a float3x2 matrix constructed from two float3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>float3x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(float3 c0, float3 c1) { return new float3x2(c0, c1); }
/// <summary>Returns a float3x2 matrix constructed from from 6 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <returns>float3x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(float m00, float m01,
float m10, float m11,
float m20, float m21)
{
return new float3x2(m00, m01,
m10, m11,
m20, m21);
}
/// <summary>Returns a float3x2 matrix constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(float v) { return new float3x2(v); }
/// <summary>Returns a float3x2 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(bool v) { return new float3x2(v); }
/// <summary>Return a float3x2 matrix constructed from a bool3x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x2 to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(bool3x2 v) { return new float3x2(v); }
/// <summary>Returns a float3x2 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(int v) { return new float3x2(v); }
/// <summary>Return a float3x2 matrix constructed from a int3x2 matrix by componentwise conversion.</summary>
/// <param name="v">int3x2 to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(int3x2 v) { return new float3x2(v); }
/// <summary>Returns a float3x2 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(uint v) { return new float3x2(v); }
/// <summary>Return a float3x2 matrix constructed from a uint3x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x2 to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(uint3x2 v) { return new float3x2(v); }
/// <summary>Returns a float3x2 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(double v) { return new float3x2(v); }
/// <summary>Return a float3x2 matrix constructed from a double3x2 matrix by componentwise conversion.</summary>
/// <param name="v">double3x2 to convert to float3x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x2 float3x2(double3x2 v) { return new float3x2(v); }
/// <summary>Return the float2x3 transpose of a float3x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x3 transpose(float3x2 v)
{
return float2x3(
v.c0.x, v.c0.y, v.c0.z,
v.c1.x, v.c1.y, v.c1.z);
}
/// <summary>Returns a uint hash code of a float3x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float3x2 v)
{
return csum(asuint(v.c0) * uint3(0xE121E6ADu, 0xC9CA1249u, 0x69B60C81u) +
asuint(v.c1) * uint3(0xE0EB6C25u, 0xF648BEABu, 0x6BDB2B07u)) + 0xEF63C699u;
}
/// <summary>
/// Returns a uint3 vector hash code of a float3x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint3 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint3 hashwide(float3x2 v)
{
return (asuint(v.c0) * uint3(0x9001903Fu, 0xA895B9CDu, 0x9D23B201u) +
asuint(v.c1) * uint3(0x4B01D3E1u, 0x7461CA0Du, 0x79725379u)) + 0xD6258E5Bu;
}
}
}

View File

@@ -0,0 +1,697 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 3x3 matrix of floats.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float3x3 : System.IEquatable<float3x3>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public float3 c0;
/// <summary>Column 1 of the matrix.</summary>
public float3 c1;
/// <summary>Column 2 of the matrix.</summary>
public float3 c2;
/// <summary>float3x3 identity transform.</summary>
public static readonly float3x3 identity = new float3x3(1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
/// <summary>float3x3 zero value.</summary>
public static readonly float3x3 zero;
/// <summary>Constructs a float3x3 matrix from three float3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(float3 c0, float3 c1, float3 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a float3x3 matrix from 9 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(float m00, float m01, float m02,
float m10, float m11, float m12,
float m20, float m21, float m22)
{
this.c0 = new float3(m00, m10, m20);
this.c1 = new float3(m01, m11, m21);
this.c2 = new float3(m02, m12, m22);
}
/// <summary>Constructs a float3x3 matrix from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a float3x3 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(bool v)
{
this.c0 = math.select(new float3(0.0f), new float3(1.0f), v);
this.c1 = math.select(new float3(0.0f), new float3(1.0f), v);
this.c2 = math.select(new float3(0.0f), new float3(1.0f), v);
}
/// <summary>Constructs a float3x3 matrix from a bool3x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x3 to convert to float3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(bool3x3 v)
{
this.c0 = math.select(new float3(0.0f), new float3(1.0f), v.c0);
this.c1 = math.select(new float3(0.0f), new float3(1.0f), v.c1);
this.c2 = math.select(new float3(0.0f), new float3(1.0f), v.c2);
}
/// <summary>Constructs a float3x3 matrix from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a float3x3 matrix from a int3x3 matrix by componentwise conversion.</summary>
/// <param name="v">int3x3 to convert to float3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(int3x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a float3x3 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a float3x3 matrix from a uint3x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x3 to convert to float3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(uint3x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a float3x3 matrix from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(double v)
{
this.c0 = (float3)v;
this.c1 = (float3)v;
this.c2 = (float3)v;
}
/// <summary>Constructs a float3x3 matrix from a double3x3 matrix by componentwise conversion.</summary>
/// <param name="v">double3x3 to convert to float3x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x3(double3x3 v)
{
this.c0 = (float3)v.c0;
this.c1 = (float3)v.c1;
this.c2 = (float3)v.c2;
}
/// <summary>Implicitly converts a single float value to a float3x3 matrix by assigning it to every component.</summary>
/// <param name="v">float to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x3(float v) { return new float3x3(v); }
/// <summary>Explicitly converts a single bool value to a float3x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x3(bool v) { return new float3x3(v); }
/// <summary>Explicitly converts a bool3x3 matrix to a float3x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x3 to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x3(bool3x3 v) { return new float3x3(v); }
/// <summary>Implicitly converts a single int value to a float3x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x3(int v) { return new float3x3(v); }
/// <summary>Implicitly converts a int3x3 matrix to a float3x3 matrix by componentwise conversion.</summary>
/// <param name="v">int3x3 to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x3(int3x3 v) { return new float3x3(v); }
/// <summary>Implicitly converts a single uint value to a float3x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x3(uint v) { return new float3x3(v); }
/// <summary>Implicitly converts a uint3x3 matrix to a float3x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x3 to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x3(uint3x3 v) { return new float3x3(v); }
/// <summary>Explicitly converts a single double value to a float3x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x3(double v) { return new float3x3(v); }
/// <summary>Explicitly converts a double3x3 matrix to a float3x3 matrix by componentwise conversion.</summary>
/// <param name="v">double3x3 to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x3(double3x3 v) { return new float3x3(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise multiplication.</param>
/// <returns>float3x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator * (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); }
/// <summary>Returns the result of a componentwise multiplication operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float3x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator * (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise multiplication.</param>
/// <returns>float3x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator * (float lhs, float3x3 rhs) { return new float3x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise addition.</param>
/// <returns>float3x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator + (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float3x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator + (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise addition.</param>
/// <returns>float3x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator + (float lhs, float3x3 rhs) { return new float3x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise subtraction.</param>
/// <returns>float3x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator - (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float3x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator - (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise subtraction.</param>
/// <returns>float3x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator - (float lhs, float3x3 rhs) { return new float3x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise division.</param>
/// <returns>float3x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator / (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float3x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator / (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise division.</param>
/// <returns>float3x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator / (float lhs, float3x3 rhs) { return new float3x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise modulus.</param>
/// <returns>float3x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator % (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float3x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator % (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise modulus.</param>
/// <returns>float3x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator % (float lhs, float3x3 rhs) { return new float3x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); }
/// <summary>Returns the result of a componentwise increment operation on a float3x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float3x3 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator ++ (float3x3 val) { return new float3x3 (++val.c0, ++val.c1, ++val.c2); }
/// <summary>Returns the result of a componentwise decrement operation on a float3x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float3x3 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator -- (float3x3 val) { return new float3x3 (--val.c0, --val.c1, --val.c2); }
/// <summary>Returns the result of a componentwise less than operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise less than.</param>
/// <returns>bool3x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator < (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); }
/// <summary>Returns the result of a componentwise less than operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool3x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator < (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise less than.</param>
/// <returns>bool3x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator < (float lhs, float3x3 rhs) { return new bool3x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise less or equal.</param>
/// <returns>bool3x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator <= (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool3x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator <= (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise less or equal.</param>
/// <returns>bool3x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator <= (float lhs, float3x3 rhs) { return new bool3x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise greater than.</param>
/// <returns>bool3x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator > (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool3x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator > (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise greater than.</param>
/// <returns>bool3x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator > (float lhs, float3x3 rhs) { return new bool3x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator >= (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool3x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator >= (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator >= (float lhs, float3x3 rhs) { return new bool3x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); }
/// <summary>Returns the result of a componentwise unary minus operation on a float3x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float3x3 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator - (float3x3 val) { return new float3x3 (-val.c0, -val.c1, -val.c2); }
/// <summary>Returns the result of a componentwise unary plus operation on a float3x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float3x3 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 operator + (float3x3 val) { return new float3x3 (+val.c0, +val.c1, +val.c2); }
/// <summary>Returns the result of a componentwise equality operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise equality.</param>
/// <returns>bool3x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator == (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool3x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator == (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise equality.</param>
/// <returns>bool3x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator == (float lhs, float3x3 rhs) { return new bool3x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two float3x3 matrices.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise not equal.</param>
/// <returns>bool3x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator != (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on a float3x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool3x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator != (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float3x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float3x3 to use to compute componentwise not equal.</param>
/// <returns>bool3x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x3 operator != (float lhs, float3x3 rhs) { return new bool3x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the float3 element at a specified index.</summary>
unsafe public ref float3 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (float3x3* array = &this) { return ref ((float3*)array)[index]; }
}
}
/// <summary>Returns true if the float3x3 is equal to a given float3x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float3x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the float3x3 is equal to a given float3x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float3x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the float3x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float3x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float3x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f)", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z);
}
/// <summary>Returns a string representation of the float3x3 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float3x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a float3x3 matrix constructed from three float3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>float3x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(float3 c0, float3 c1, float3 c2) { return new float3x3(c0, c1, c2); }
/// <summary>Returns a float3x3 matrix constructed from from 9 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <returns>float3x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(float m00, float m01, float m02,
float m10, float m11, float m12,
float m20, float m21, float m22)
{
return new float3x3(m00, m01, m02,
m10, m11, m12,
m20, m21, m22);
}
/// <summary>Returns a float3x3 matrix constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(float v) { return new float3x3(v); }
/// <summary>Returns a float3x3 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(bool v) { return new float3x3(v); }
/// <summary>Return a float3x3 matrix constructed from a bool3x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x3 to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(bool3x3 v) { return new float3x3(v); }
/// <summary>Returns a float3x3 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(int v) { return new float3x3(v); }
/// <summary>Return a float3x3 matrix constructed from a int3x3 matrix by componentwise conversion.</summary>
/// <param name="v">int3x3 to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(int3x3 v) { return new float3x3(v); }
/// <summary>Returns a float3x3 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(uint v) { return new float3x3(v); }
/// <summary>Return a float3x3 matrix constructed from a uint3x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x3 to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(uint3x3 v) { return new float3x3(v); }
/// <summary>Returns a float3x3 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(double v) { return new float3x3(v); }
/// <summary>Return a float3x3 matrix constructed from a double3x3 matrix by componentwise conversion.</summary>
/// <param name="v">double3x3 to convert to float3x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 float3x3(double3x3 v) { return new float3x3(v); }
/// <summary>Return the float3x3 transpose of a float3x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x3 transpose(float3x3 v)
{
return float3x3(
v.c0.x, v.c0.y, v.c0.z,
v.c1.x, v.c1.y, v.c1.z,
v.c2.x, v.c2.y, v.c2.z);
}
/// <summary>Returns the float3x3 full inverse of a float3x3 matrix.</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
public static float3x3 inverse(float3x3 m)
{
float3 c0 = m.c0;
float3 c1 = m.c1;
float3 c2 = m.c2;
float3 t0 = float3(c1.x, c2.x, c0.x);
float3 t1 = float3(c1.y, c2.y, c0.y);
float3 t2 = float3(c1.z, c2.z, c0.z);
float3 m0 = t1 * t2.yzx - t1.yzx * t2;
float3 m1 = t0.yzx * t2 - t0 * t2.yzx;
float3 m2 = t0 * t1.yzx - t0.yzx * t1;
float rcpDet = 1.0f / csum(t0.zxy * m0);
return float3x3(m0, m1, m2) * rcpDet;
}
/// <summary>Returns the determinant of a float3x3 matrix.</summary>
/// <param name="m">Matrix to use when computing determinant.</param>
/// <returns>The determinant of the matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float determinant(float3x3 m)
{
float3 c0 = m.c0;
float3 c1 = m.c1;
float3 c2 = m.c2;
float m00 = c1.y * c2.z - c1.z * c2.y;
float m01 = c0.y * c2.z - c0.z * c2.y;
float m02 = c0.y * c1.z - c0.z * c1.y;
return c0.x * m00 - c1.x * m01 + c2.x * m02;
}
/// <summary>Returns a uint hash code of a float3x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float3x3 v)
{
return csum(asuint(v.c0) * uint3(0x713BD06Fu, 0x753AD6ADu, 0xD19764C7u) +
asuint(v.c1) * uint3(0xB5D0BF63u, 0xF9102C5Fu, 0x9881FB9Fu) +
asuint(v.c2) * uint3(0x56A1530Du, 0x804B722Du, 0x738E50E5u)) + 0x4FC93C25u;
}
/// <summary>
/// Returns a uint3 vector hash code of a float3x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint3 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint3 hashwide(float3x3 v)
{
return (asuint(v.c0) * uint3(0xCD0445A5u, 0xD2B90D9Bu, 0xD35C9B2Du) +
asuint(v.c1) * uint3(0xA10D9E27u, 0x568DAAA9u, 0x7530254Fu) +
asuint(v.c2) * uint3(0x9F090439u, 0x5E9F85C9u, 0x8C4CA03Fu)) + 0xB8D969EDu;
}
}
}

View File

@@ -0,0 +1,699 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 3x4 matrix of floats.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float3x4 : System.IEquatable<float3x4>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public float3 c0;
/// <summary>Column 1 of the matrix.</summary>
public float3 c1;
/// <summary>Column 2 of the matrix.</summary>
public float3 c2;
/// <summary>Column 3 of the matrix.</summary>
public float3 c3;
/// <summary>float3x4 zero value.</summary>
public static readonly float3x4 zero;
/// <summary>Constructs a float3x4 matrix from four float3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(float3 c0, float3 c1, float3 c2, float3 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a float3x4 matrix from 12 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23)
{
this.c0 = new float3(m00, m10, m20);
this.c1 = new float3(m01, m11, m21);
this.c2 = new float3(m02, m12, m22);
this.c3 = new float3(m03, m13, m23);
}
/// <summary>Constructs a float3x4 matrix from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a float3x4 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(bool v)
{
this.c0 = math.select(new float3(0.0f), new float3(1.0f), v);
this.c1 = math.select(new float3(0.0f), new float3(1.0f), v);
this.c2 = math.select(new float3(0.0f), new float3(1.0f), v);
this.c3 = math.select(new float3(0.0f), new float3(1.0f), v);
}
/// <summary>Constructs a float3x4 matrix from a bool3x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x4 to convert to float3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(bool3x4 v)
{
this.c0 = math.select(new float3(0.0f), new float3(1.0f), v.c0);
this.c1 = math.select(new float3(0.0f), new float3(1.0f), v.c1);
this.c2 = math.select(new float3(0.0f), new float3(1.0f), v.c2);
this.c3 = math.select(new float3(0.0f), new float3(1.0f), v.c3);
}
/// <summary>Constructs a float3x4 matrix from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a float3x4 matrix from a int3x4 matrix by componentwise conversion.</summary>
/// <param name="v">int3x4 to convert to float3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(int3x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a float3x4 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a float3x4 matrix from a uint3x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x4 to convert to float3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(uint3x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a float3x4 matrix from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(double v)
{
this.c0 = (float3)v;
this.c1 = (float3)v;
this.c2 = (float3)v;
this.c3 = (float3)v;
}
/// <summary>Constructs a float3x4 matrix from a double3x4 matrix by componentwise conversion.</summary>
/// <param name="v">double3x4 to convert to float3x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float3x4(double3x4 v)
{
this.c0 = (float3)v.c0;
this.c1 = (float3)v.c1;
this.c2 = (float3)v.c2;
this.c3 = (float3)v.c3;
}
/// <summary>Implicitly converts a single float value to a float3x4 matrix by assigning it to every component.</summary>
/// <param name="v">float to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x4(float v) { return new float3x4(v); }
/// <summary>Explicitly converts a single bool value to a float3x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x4(bool v) { return new float3x4(v); }
/// <summary>Explicitly converts a bool3x4 matrix to a float3x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x4 to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x4(bool3x4 v) { return new float3x4(v); }
/// <summary>Implicitly converts a single int value to a float3x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x4(int v) { return new float3x4(v); }
/// <summary>Implicitly converts a int3x4 matrix to a float3x4 matrix by componentwise conversion.</summary>
/// <param name="v">int3x4 to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x4(int3x4 v) { return new float3x4(v); }
/// <summary>Implicitly converts a single uint value to a float3x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x4(uint v) { return new float3x4(v); }
/// <summary>Implicitly converts a uint3x4 matrix to a float3x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x4 to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float3x4(uint3x4 v) { return new float3x4(v); }
/// <summary>Explicitly converts a single double value to a float3x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x4(double v) { return new float3x4(v); }
/// <summary>Explicitly converts a double3x4 matrix to a float3x4 matrix by componentwise conversion.</summary>
/// <param name="v">double3x4 to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float3x4(double3x4 v) { return new float3x4(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise multiplication.</param>
/// <returns>float3x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator * (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
/// <summary>Returns the result of a componentwise multiplication operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float3x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator * (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise multiplication.</param>
/// <returns>float3x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator * (float lhs, float3x4 rhs) { return new float3x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise addition.</param>
/// <returns>float3x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator + (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float3x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator + (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise addition.</param>
/// <returns>float3x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator + (float lhs, float3x4 rhs) { return new float3x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise subtraction.</param>
/// <returns>float3x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator - (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float3x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator - (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise subtraction.</param>
/// <returns>float3x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator - (float lhs, float3x4 rhs) { return new float3x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise division.</param>
/// <returns>float3x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator / (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float3x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator / (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise division.</param>
/// <returns>float3x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator / (float lhs, float3x4 rhs) { return new float3x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise modulus.</param>
/// <returns>float3x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator % (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float3x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator % (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise modulus.</param>
/// <returns>float3x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator % (float lhs, float3x4 rhs) { return new float3x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
/// <summary>Returns the result of a componentwise increment operation on a float3x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float3x4 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator ++ (float3x4 val) { return new float3x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
/// <summary>Returns the result of a componentwise decrement operation on a float3x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float3x4 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator -- (float3x4 val) { return new float3x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
/// <summary>Returns the result of a componentwise less than operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise less than.</param>
/// <returns>bool3x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator < (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
/// <summary>Returns the result of a componentwise less than operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool3x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator < (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise less than.</param>
/// <returns>bool3x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator < (float lhs, float3x4 rhs) { return new bool3x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise less or equal.</param>
/// <returns>bool3x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator <= (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool3x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator <= (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise less or equal.</param>
/// <returns>bool3x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator <= (float lhs, float3x4 rhs) { return new bool3x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise greater than.</param>
/// <returns>bool3x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator > (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool3x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator > (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise greater than.</param>
/// <returns>bool3x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator > (float lhs, float3x4 rhs) { return new bool3x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator >= (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool3x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator >= (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool3x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator >= (float lhs, float3x4 rhs) { return new bool3x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
/// <summary>Returns the result of a componentwise unary minus operation on a float3x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float3x4 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator - (float3x4 val) { return new float3x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
/// <summary>Returns the result of a componentwise unary plus operation on a float3x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float3x4 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 operator + (float3x4 val) { return new float3x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
/// <summary>Returns the result of a componentwise equality operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise equality.</param>
/// <returns>bool3x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator == (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool3x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator == (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise equality.</param>
/// <returns>bool3x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator == (float lhs, float3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two float3x4 matrices.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise not equal.</param>
/// <returns>bool3x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator != (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on a float3x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float3x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool3x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator != (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float3x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float3x4 to use to compute componentwise not equal.</param>
/// <returns>bool3x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool3x4 operator != (float lhs, float3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the float3 element at a specified index.</summary>
unsafe public ref float3 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (float3x4* array = &this) { return ref ((float3*)array)[index]; }
}
}
/// <summary>Returns true if the float3x4 is equal to a given float3x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the float3x4 is equal to a given float3x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float3x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the float3x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float3x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float3x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z);
}
/// <summary>Returns a string representation of the float3x4 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float3x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a float3x4 matrix constructed from four float3 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>float3x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(float3 c0, float3 c1, float3 c2, float3 c3) { return new float3x4(c0, c1, c2, c3); }
/// <summary>Returns a float3x4 matrix constructed from from 12 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
/// <returns>float3x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23)
{
return new float3x4(m00, m01, m02, m03,
m10, m11, m12, m13,
m20, m21, m22, m23);
}
/// <summary>Returns a float3x4 matrix constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(float v) { return new float3x4(v); }
/// <summary>Returns a float3x4 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(bool v) { return new float3x4(v); }
/// <summary>Return a float3x4 matrix constructed from a bool3x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool3x4 to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(bool3x4 v) { return new float3x4(v); }
/// <summary>Returns a float3x4 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(int v) { return new float3x4(v); }
/// <summary>Return a float3x4 matrix constructed from a int3x4 matrix by componentwise conversion.</summary>
/// <param name="v">int3x4 to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(int3x4 v) { return new float3x4(v); }
/// <summary>Returns a float3x4 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(uint v) { return new float3x4(v); }
/// <summary>Return a float3x4 matrix constructed from a uint3x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint3x4 to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(uint3x4 v) { return new float3x4(v); }
/// <summary>Returns a float3x4 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(double v) { return new float3x4(v); }
/// <summary>Return a float3x4 matrix constructed from a double3x4 matrix by componentwise conversion.</summary>
/// <param name="v">double3x4 to convert to float3x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 float3x4(double3x4 v) { return new float3x4(v); }
/// <summary>Return the float4x3 transpose of a float3x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 transpose(float3x4 v)
{
return float4x3(
v.c0.x, v.c0.y, v.c0.z,
v.c1.x, v.c1.y, v.c1.z,
v.c2.x, v.c2.y, v.c2.z,
v.c3.x, v.c3.y, v.c3.z);
}
/// <summary>Fast matrix inverse for rigid transforms (orthonormal basis and translation)</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
public static float3x4 fastinverse(float3x4 m)
{
float3 c0 = m.c0;
float3 c1 = m.c1;
float3 c2 = m.c2;
float3 pos = m.c3;
float3 r0 = float3(c0.x, c1.x, c2.x);
float3 r1 = float3(c0.y, c1.y, c2.y);
float3 r2 = float3(c0.z, c1.z, c2.z);
pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z);
return float3x4(r0, r1, r2, pos);
}
/// <summary>Returns a uint hash code of a float3x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float3x4 v)
{
return csum(asuint(v.c0) * uint3(0xF9EA92D5u, 0xC2FAFCB9u, 0x616E9CA1u) +
asuint(v.c1) * uint3(0xC5C5394Bu, 0xCAE78587u, 0x7A1541C9u) +
asuint(v.c2) * uint3(0xF83BD927u, 0x6A243BCBu, 0x509B84C9u) +
asuint(v.c3) * uint3(0x91D13847u, 0x52F7230Fu, 0xCF286E83u)) + 0xE121E6ADu;
}
/// <summary>
/// Returns a uint3 vector hash code of a float3x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint3 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint3 hashwide(float3x4 v)
{
return (asuint(v.c0) * uint3(0xC9CA1249u, 0x69B60C81u, 0xE0EB6C25u) +
asuint(v.c1) * uint3(0xF648BEABu, 0x6BDB2B07u, 0xEF63C699u) +
asuint(v.c2) * uint3(0x9001903Fu, 0xA895B9CDu, 0x9D23B201u) +
asuint(v.c3) * uint3(0x4B01D3E1u, 0x7461CA0Du, 0x79725379u)) + 0xD6258E5Bu;
}
}
}

4052
ThirdParty/Unity.Mathematics/float4.gen.cs vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,639 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 4x2 matrix of floats.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float4x2 : System.IEquatable<float4x2>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public float4 c0;
/// <summary>Column 1 of the matrix.</summary>
public float4 c1;
/// <summary>float4x2 zero value.</summary>
public static readonly float4x2 zero;
/// <summary>Constructs a float4x2 matrix from two float4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(float4 c0, float4 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a float4x2 matrix from 8 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(float m00, float m01,
float m10, float m11,
float m20, float m21,
float m30, float m31)
{
this.c0 = new float4(m00, m10, m20, m30);
this.c1 = new float4(m01, m11, m21, m31);
}
/// <summary>Constructs a float4x2 matrix from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(float v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a float4x2 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(bool v)
{
this.c0 = math.select(new float4(0.0f), new float4(1.0f), v);
this.c1 = math.select(new float4(0.0f), new float4(1.0f), v);
}
/// <summary>Constructs a float4x2 matrix from a bool4x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x2 to convert to float4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(bool4x2 v)
{
this.c0 = math.select(new float4(0.0f), new float4(1.0f), v.c0);
this.c1 = math.select(new float4(0.0f), new float4(1.0f), v.c1);
}
/// <summary>Constructs a float4x2 matrix from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(int v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a float4x2 matrix from a int4x2 matrix by componentwise conversion.</summary>
/// <param name="v">int4x2 to convert to float4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(int4x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a float4x2 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(uint v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a float4x2 matrix from a uint4x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x2 to convert to float4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(uint4x2 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
}
/// <summary>Constructs a float4x2 matrix from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(double v)
{
this.c0 = (float4)v;
this.c1 = (float4)v;
}
/// <summary>Constructs a float4x2 matrix from a double4x2 matrix by componentwise conversion.</summary>
/// <param name="v">double4x2 to convert to float4x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x2(double4x2 v)
{
this.c0 = (float4)v.c0;
this.c1 = (float4)v.c1;
}
/// <summary>Implicitly converts a single float value to a float4x2 matrix by assigning it to every component.</summary>
/// <param name="v">float to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x2(float v) { return new float4x2(v); }
/// <summary>Explicitly converts a single bool value to a float4x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x2(bool v) { return new float4x2(v); }
/// <summary>Explicitly converts a bool4x2 matrix to a float4x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x2 to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x2(bool4x2 v) { return new float4x2(v); }
/// <summary>Implicitly converts a single int value to a float4x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x2(int v) { return new float4x2(v); }
/// <summary>Implicitly converts a int4x2 matrix to a float4x2 matrix by componentwise conversion.</summary>
/// <param name="v">int4x2 to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x2(int4x2 v) { return new float4x2(v); }
/// <summary>Implicitly converts a single uint value to a float4x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x2(uint v) { return new float4x2(v); }
/// <summary>Implicitly converts a uint4x2 matrix to a float4x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x2 to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x2(uint4x2 v) { return new float4x2(v); }
/// <summary>Explicitly converts a single double value to a float4x2 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x2(double v) { return new float4x2(v); }
/// <summary>Explicitly converts a double4x2 matrix to a float4x2 matrix by componentwise conversion.</summary>
/// <param name="v">double4x2 to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x2(double4x2 v) { return new float4x2(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise multiplication.</param>
/// <returns>float4x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator * (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
/// <summary>Returns the result of a componentwise multiplication operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float4x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator * (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise multiplication.</param>
/// <returns>float4x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator * (float lhs, float4x2 rhs) { return new float4x2 (lhs * rhs.c0, lhs * rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise addition.</param>
/// <returns>float4x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator + (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float4x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator + (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise addition.</param>
/// <returns>float4x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator + (float lhs, float4x2 rhs) { return new float4x2 (lhs + rhs.c0, lhs + rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise subtraction.</param>
/// <returns>float4x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator - (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float4x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator - (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise subtraction.</param>
/// <returns>float4x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator - (float lhs, float4x2 rhs) { return new float4x2 (lhs - rhs.c0, lhs - rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise division.</param>
/// <returns>float4x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator / (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float4x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator / (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise division.</param>
/// <returns>float4x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator / (float lhs, float4x2 rhs) { return new float4x2 (lhs / rhs.c0, lhs / rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise modulus.</param>
/// <returns>float4x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator % (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float4x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator % (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise modulus.</param>
/// <returns>float4x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator % (float lhs, float4x2 rhs) { return new float4x2 (lhs % rhs.c0, lhs % rhs.c1); }
/// <summary>Returns the result of a componentwise increment operation on a float4x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float4x2 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator ++ (float4x2 val) { return new float4x2 (++val.c0, ++val.c1); }
/// <summary>Returns the result of a componentwise decrement operation on a float4x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float4x2 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator -- (float4x2 val) { return new float4x2 (--val.c0, --val.c1); }
/// <summary>Returns the result of a componentwise less than operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise less than.</param>
/// <returns>bool4x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator < (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
/// <summary>Returns the result of a componentwise less than operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool4x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator < (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise less than.</param>
/// <returns>bool4x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator < (float lhs, float4x2 rhs) { return new bool4x2 (lhs < rhs.c0, lhs < rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise less or equal.</param>
/// <returns>bool4x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator <= (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool4x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator <= (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise less or equal.</param>
/// <returns>bool4x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator <= (float lhs, float4x2 rhs) { return new bool4x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise greater than.</param>
/// <returns>bool4x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator > (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool4x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator > (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise greater than.</param>
/// <returns>bool4x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator > (float lhs, float4x2 rhs) { return new bool4x2 (lhs > rhs.c0, lhs > rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator >= (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool4x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator >= (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator >= (float lhs, float4x2 rhs) { return new bool4x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
/// <summary>Returns the result of a componentwise unary minus operation on a float4x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float4x2 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator - (float4x2 val) { return new float4x2 (-val.c0, -val.c1); }
/// <summary>Returns the result of a componentwise unary plus operation on a float4x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float4x2 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 operator + (float4x2 val) { return new float4x2 (+val.c0, +val.c1); }
/// <summary>Returns the result of a componentwise equality operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise equality.</param>
/// <returns>bool4x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator == (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool4x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator == (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise equality.</param>
/// <returns>bool4x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator == (float lhs, float4x2 rhs) { return new bool4x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two float4x2 matrices.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise not equal.</param>
/// <returns>bool4x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator != (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on a float4x2 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool4x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator != (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float4x2 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float4x2 to use to compute componentwise not equal.</param>
/// <returns>bool4x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x2 operator != (float lhs, float4x2 rhs) { return new bool4x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the float4 element at a specified index.</summary>
unsafe public ref float4 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (float4x2* array = &this) { return ref ((float4*)array)[index]; }
}
}
/// <summary>Returns true if the float4x2 is equal to a given float4x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float4x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the float4x2 is equal to a given float4x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float4x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the float4x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float4x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float4x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f)", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z, c0.w, c1.w);
}
/// <summary>Returns a string representation of the float4x2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float4x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a float4x2 matrix constructed from two float4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>float4x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(float4 c0, float4 c1) { return new float4x2(c0, c1); }
/// <summary>Returns a float4x2 matrix constructed from from 8 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <returns>float4x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(float m00, float m01,
float m10, float m11,
float m20, float m21,
float m30, float m31)
{
return new float4x2(m00, m01,
m10, m11,
m20, m21,
m30, m31);
}
/// <summary>Returns a float4x2 matrix constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(float v) { return new float4x2(v); }
/// <summary>Returns a float4x2 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(bool v) { return new float4x2(v); }
/// <summary>Return a float4x2 matrix constructed from a bool4x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x2 to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(bool4x2 v) { return new float4x2(v); }
/// <summary>Returns a float4x2 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(int v) { return new float4x2(v); }
/// <summary>Return a float4x2 matrix constructed from a int4x2 matrix by componentwise conversion.</summary>
/// <param name="v">int4x2 to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(int4x2 v) { return new float4x2(v); }
/// <summary>Returns a float4x2 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(uint v) { return new float4x2(v); }
/// <summary>Return a float4x2 matrix constructed from a uint4x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x2 to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(uint4x2 v) { return new float4x2(v); }
/// <summary>Returns a float4x2 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(double v) { return new float4x2(v); }
/// <summary>Return a float4x2 matrix constructed from a double4x2 matrix by componentwise conversion.</summary>
/// <param name="v">double4x2 to convert to float4x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x2 float4x2(double4x2 v) { return new float4x2(v); }
/// <summary>Return the float2x4 transpose of a float4x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float2x4 transpose(float4x2 v)
{
return float2x4(
v.c0.x, v.c0.y, v.c0.z, v.c0.w,
v.c1.x, v.c1.y, v.c1.z, v.c1.w);
}
/// <summary>Returns a uint hash code of a float4x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float4x2 v)
{
return csum(asuint(v.c0) * uint4(0xAAC3C25Du, 0xD21D0945u, 0x88FCAB2Du, 0x614DA60Du) +
asuint(v.c1) * uint4(0x5BA2C50Bu, 0x8C455ACBu, 0xCD266C89u, 0xF1852A33u)) + 0x77E35E77u;
}
/// <summary>
/// Returns a uint4 vector hash code of a float4x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint4 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(float4x2 v)
{
return (asuint(v.c0) * uint4(0x863E3729u, 0xE191B035u, 0x68586FAFu, 0xD4DFF6D3u) +
asuint(v.c1) * uint4(0xCB634F4Du, 0x9B13B92Du, 0x4ABF0813u, 0x86068063u)) + 0xD75513F9u;
}
}
}

View File

@@ -0,0 +1,665 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 4x3 matrix of floats.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float4x3 : System.IEquatable<float4x3>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public float4 c0;
/// <summary>Column 1 of the matrix.</summary>
public float4 c1;
/// <summary>Column 2 of the matrix.</summary>
public float4 c2;
/// <summary>float4x3 zero value.</summary>
public static readonly float4x3 zero;
/// <summary>Constructs a float4x3 matrix from three float4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(float4 c0, float4 c1, float4 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a float4x3 matrix from 12 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(float m00, float m01, float m02,
float m10, float m11, float m12,
float m20, float m21, float m22,
float m30, float m31, float m32)
{
this.c0 = new float4(m00, m10, m20, m30);
this.c1 = new float4(m01, m11, m21, m31);
this.c2 = new float4(m02, m12, m22, m32);
}
/// <summary>Constructs a float4x3 matrix from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a float4x3 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(bool v)
{
this.c0 = math.select(new float4(0.0f), new float4(1.0f), v);
this.c1 = math.select(new float4(0.0f), new float4(1.0f), v);
this.c2 = math.select(new float4(0.0f), new float4(1.0f), v);
}
/// <summary>Constructs a float4x3 matrix from a bool4x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x3 to convert to float4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(bool4x3 v)
{
this.c0 = math.select(new float4(0.0f), new float4(1.0f), v.c0);
this.c1 = math.select(new float4(0.0f), new float4(1.0f), v.c1);
this.c2 = math.select(new float4(0.0f), new float4(1.0f), v.c2);
}
/// <summary>Constructs a float4x3 matrix from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a float4x3 matrix from a int4x3 matrix by componentwise conversion.</summary>
/// <param name="v">int4x3 to convert to float4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(int4x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a float4x3 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a float4x3 matrix from a uint4x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x3 to convert to float4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(uint4x3 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
}
/// <summary>Constructs a float4x3 matrix from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(double v)
{
this.c0 = (float4)v;
this.c1 = (float4)v;
this.c2 = (float4)v;
}
/// <summary>Constructs a float4x3 matrix from a double4x3 matrix by componentwise conversion.</summary>
/// <param name="v">double4x3 to convert to float4x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x3(double4x3 v)
{
this.c0 = (float4)v.c0;
this.c1 = (float4)v.c1;
this.c2 = (float4)v.c2;
}
/// <summary>Implicitly converts a single float value to a float4x3 matrix by assigning it to every component.</summary>
/// <param name="v">float to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x3(float v) { return new float4x3(v); }
/// <summary>Explicitly converts a single bool value to a float4x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x3(bool v) { return new float4x3(v); }
/// <summary>Explicitly converts a bool4x3 matrix to a float4x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x3 to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x3(bool4x3 v) { return new float4x3(v); }
/// <summary>Implicitly converts a single int value to a float4x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x3(int v) { return new float4x3(v); }
/// <summary>Implicitly converts a int4x3 matrix to a float4x3 matrix by componentwise conversion.</summary>
/// <param name="v">int4x3 to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x3(int4x3 v) { return new float4x3(v); }
/// <summary>Implicitly converts a single uint value to a float4x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x3(uint v) { return new float4x3(v); }
/// <summary>Implicitly converts a uint4x3 matrix to a float4x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x3 to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x3(uint4x3 v) { return new float4x3(v); }
/// <summary>Explicitly converts a single double value to a float4x3 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x3(double v) { return new float4x3(v); }
/// <summary>Explicitly converts a double4x3 matrix to a float4x3 matrix by componentwise conversion.</summary>
/// <param name="v">double4x3 to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x3(double4x3 v) { return new float4x3(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise multiplication.</param>
/// <returns>float4x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator * (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); }
/// <summary>Returns the result of a componentwise multiplication operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float4x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator * (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise multiplication.</param>
/// <returns>float4x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator * (float lhs, float4x3 rhs) { return new float4x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise addition.</param>
/// <returns>float4x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator + (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float4x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator + (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise addition.</param>
/// <returns>float4x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator + (float lhs, float4x3 rhs) { return new float4x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise subtraction.</param>
/// <returns>float4x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator - (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float4x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator - (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise subtraction.</param>
/// <returns>float4x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator - (float lhs, float4x3 rhs) { return new float4x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise division.</param>
/// <returns>float4x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator / (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float4x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator / (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise division.</param>
/// <returns>float4x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator / (float lhs, float4x3 rhs) { return new float4x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise modulus.</param>
/// <returns>float4x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator % (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float4x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator % (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise modulus.</param>
/// <returns>float4x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator % (float lhs, float4x3 rhs) { return new float4x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); }
/// <summary>Returns the result of a componentwise increment operation on a float4x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float4x3 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator ++ (float4x3 val) { return new float4x3 (++val.c0, ++val.c1, ++val.c2); }
/// <summary>Returns the result of a componentwise decrement operation on a float4x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float4x3 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator -- (float4x3 val) { return new float4x3 (--val.c0, --val.c1, --val.c2); }
/// <summary>Returns the result of a componentwise less than operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise less than.</param>
/// <returns>bool4x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator < (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); }
/// <summary>Returns the result of a componentwise less than operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool4x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator < (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise less than.</param>
/// <returns>bool4x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator < (float lhs, float4x3 rhs) { return new bool4x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise less or equal.</param>
/// <returns>bool4x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator <= (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool4x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator <= (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise less or equal.</param>
/// <returns>bool4x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator <= (float lhs, float4x3 rhs) { return new bool4x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise greater than.</param>
/// <returns>bool4x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator > (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool4x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator > (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise greater than.</param>
/// <returns>bool4x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator > (float lhs, float4x3 rhs) { return new bool4x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator >= (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool4x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator >= (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator >= (float lhs, float4x3 rhs) { return new bool4x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); }
/// <summary>Returns the result of a componentwise unary minus operation on a float4x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float4x3 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator - (float4x3 val) { return new float4x3 (-val.c0, -val.c1, -val.c2); }
/// <summary>Returns the result of a componentwise unary plus operation on a float4x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float4x3 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 operator + (float4x3 val) { return new float4x3 (+val.c0, +val.c1, +val.c2); }
/// <summary>Returns the result of a componentwise equality operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise equality.</param>
/// <returns>bool4x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator == (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool4x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator == (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise equality.</param>
/// <returns>bool4x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator == (float lhs, float4x3 rhs) { return new bool4x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two float4x3 matrices.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise not equal.</param>
/// <returns>bool4x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator != (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on a float4x3 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool4x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator != (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float4x3 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float4x3 to use to compute componentwise not equal.</param>
/// <returns>bool4x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x3 operator != (float lhs, float4x3 rhs) { return new bool4x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the float4 element at a specified index.</summary>
unsafe public ref float4 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (float4x3* array = &this) { return ref ((float4*)array)[index]; }
}
}
/// <summary>Returns true if the float4x3 is equal to a given float4x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float4x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the float4x3 is equal to a given float4x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float4x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the float4x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float4x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float4x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z, c0.w, c1.w, c2.w);
}
/// <summary>Returns a string representation of the float4x3 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float4x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a float4x3 matrix constructed from three float4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>float4x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(float4 c0, float4 c1, float4 c2) { return new float4x3(c0, c1, c2); }
/// <summary>Returns a float4x3 matrix constructed from from 12 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
/// <returns>float4x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(float m00, float m01, float m02,
float m10, float m11, float m12,
float m20, float m21, float m22,
float m30, float m31, float m32)
{
return new float4x3(m00, m01, m02,
m10, m11, m12,
m20, m21, m22,
m30, m31, m32);
}
/// <summary>Returns a float4x3 matrix constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(float v) { return new float4x3(v); }
/// <summary>Returns a float4x3 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(bool v) { return new float4x3(v); }
/// <summary>Return a float4x3 matrix constructed from a bool4x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x3 to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(bool4x3 v) { return new float4x3(v); }
/// <summary>Returns a float4x3 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(int v) { return new float4x3(v); }
/// <summary>Return a float4x3 matrix constructed from a int4x3 matrix by componentwise conversion.</summary>
/// <param name="v">int4x3 to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(int4x3 v) { return new float4x3(v); }
/// <summary>Returns a float4x3 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(uint v) { return new float4x3(v); }
/// <summary>Return a float4x3 matrix constructed from a uint4x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x3 to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(uint4x3 v) { return new float4x3(v); }
/// <summary>Returns a float4x3 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(double v) { return new float4x3(v); }
/// <summary>Return a float4x3 matrix constructed from a double4x3 matrix by componentwise conversion.</summary>
/// <param name="v">double4x3 to convert to float4x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x3 float4x3(double4x3 v) { return new float4x3(v); }
/// <summary>Return the float3x4 transpose of a float4x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3x4 transpose(float4x3 v)
{
return float3x4(
v.c0.x, v.c0.y, v.c0.z, v.c0.w,
v.c1.x, v.c1.y, v.c1.z, v.c1.w,
v.c2.x, v.c2.y, v.c2.z, v.c2.w);
}
/// <summary>Returns a uint hash code of a float4x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float4x3 v)
{
return csum(asuint(v.c0) * uint4(0xC53F4755u, 0x6985C229u, 0xE133B0B3u, 0xC3E0A3B9u) +
asuint(v.c1) * uint4(0xFE31134Fu, 0x712A34D7u, 0x9D77A59Bu, 0x4942CA39u) +
asuint(v.c2) * uint4(0xB40EC62Du, 0x565ED63Fu, 0x93C30C2Bu, 0xDCAF0351u)) + 0x6E050B01u;
}
/// <summary>
/// Returns a uint4 vector hash code of a float4x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint4 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(float4x3 v)
{
return (asuint(v.c0) * uint4(0x750FDBF5u, 0x7F3DD499u, 0x52EAAEBBu, 0x4599C793u) +
asuint(v.c1) * uint4(0x83B5E729u, 0xC267163Fu, 0x67BC9149u, 0xAD7C5EC1u) +
asuint(v.c2) * uint4(0x822A7D6Du, 0xB492BF15u, 0xD37220E3u, 0x7AA2C2BDu)) + 0xE16BC89Du;
}
}
}

View File

@@ -0,0 +1,824 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 4x4 matrix of floats.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct float4x4 : System.IEquatable<float4x4>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public float4 c0;
/// <summary>Column 1 of the matrix.</summary>
public float4 c1;
/// <summary>Column 2 of the matrix.</summary>
public float4 c2;
/// <summary>Column 3 of the matrix.</summary>
public float4 c3;
/// <summary>float4x4 identity transform.</summary>
public static readonly float4x4 identity = new float4x4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
/// <summary>float4x4 zero value.</summary>
public static readonly float4x4 zero;
/// <summary>Constructs a float4x4 matrix from four float4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(float4 c0, float4 c1, float4 c2, float4 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a float4x4 matrix from 16 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
/// <param name="m33">The matrix at row 3, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23,
float m30, float m31, float m32, float m33)
{
this.c0 = new float4(m00, m10, m20, m30);
this.c1 = new float4(m01, m11, m21, m31);
this.c2 = new float4(m02, m12, m22, m32);
this.c3 = new float4(m03, m13, m23, m33);
}
/// <summary>Constructs a float4x4 matrix from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(float v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a float4x4 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(bool v)
{
this.c0 = math.select(new float4(0.0f), new float4(1.0f), v);
this.c1 = math.select(new float4(0.0f), new float4(1.0f), v);
this.c2 = math.select(new float4(0.0f), new float4(1.0f), v);
this.c3 = math.select(new float4(0.0f), new float4(1.0f), v);
}
/// <summary>Constructs a float4x4 matrix from a bool4x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x4 to convert to float4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(bool4x4 v)
{
this.c0 = math.select(new float4(0.0f), new float4(1.0f), v.c0);
this.c1 = math.select(new float4(0.0f), new float4(1.0f), v.c1);
this.c2 = math.select(new float4(0.0f), new float4(1.0f), v.c2);
this.c3 = math.select(new float4(0.0f), new float4(1.0f), v.c3);
}
/// <summary>Constructs a float4x4 matrix from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a float4x4 matrix from a int4x4 matrix by componentwise conversion.</summary>
/// <param name="v">int4x4 to convert to float4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(int4x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a float4x4 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(uint v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a float4x4 matrix from a uint4x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x4 to convert to float4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(uint4x4 v)
{
this.c0 = v.c0;
this.c1 = v.c1;
this.c2 = v.c2;
this.c3 = v.c3;
}
/// <summary>Constructs a float4x4 matrix from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(double v)
{
this.c0 = (float4)v;
this.c1 = (float4)v;
this.c2 = (float4)v;
this.c3 = (float4)v;
}
/// <summary>Constructs a float4x4 matrix from a double4x4 matrix by componentwise conversion.</summary>
/// <param name="v">double4x4 to convert to float4x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float4x4(double4x4 v)
{
this.c0 = (float4)v.c0;
this.c1 = (float4)v.c1;
this.c2 = (float4)v.c2;
this.c3 = (float4)v.c3;
}
/// <summary>Implicitly converts a single float value to a float4x4 matrix by assigning it to every component.</summary>
/// <param name="v">float to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x4(float v) { return new float4x4(v); }
/// <summary>Explicitly converts a single bool value to a float4x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x4(bool v) { return new float4x4(v); }
/// <summary>Explicitly converts a bool4x4 matrix to a float4x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x4 to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x4(bool4x4 v) { return new float4x4(v); }
/// <summary>Implicitly converts a single int value to a float4x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x4(int v) { return new float4x4(v); }
/// <summary>Implicitly converts a int4x4 matrix to a float4x4 matrix by componentwise conversion.</summary>
/// <param name="v">int4x4 to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x4(int4x4 v) { return new float4x4(v); }
/// <summary>Implicitly converts a single uint value to a float4x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x4(uint v) { return new float4x4(v); }
/// <summary>Implicitly converts a uint4x4 matrix to a float4x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x4 to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float4x4(uint4x4 v) { return new float4x4(v); }
/// <summary>Explicitly converts a single double value to a float4x4 matrix by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x4(double v) { return new float4x4(v); }
/// <summary>Explicitly converts a double4x4 matrix to a float4x4 matrix by componentwise conversion.</summary>
/// <param name="v">double4x4 to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator float4x4(double4x4 v) { return new float4x4(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise multiplication.</param>
/// <returns>float4x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator * (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
/// <summary>Returns the result of a componentwise multiplication operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
/// <returns>float4x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator * (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise multiplication.</param>
/// <returns>float4x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator * (float lhs, float4x4 rhs) { return new float4x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise addition.</param>
/// <returns>float4x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator + (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
/// <returns>float4x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator + (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise addition.</param>
/// <returns>float4x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator + (float lhs, float4x4 rhs) { return new float4x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise subtraction.</param>
/// <returns>float4x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator - (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
/// <returns>float4x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator - (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise subtraction.</param>
/// <returns>float4x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator - (float lhs, float4x4 rhs) { return new float4x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise division.</param>
/// <returns>float4x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator / (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
/// <returns>float4x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator / (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
/// <summary>Returns the result of a componentwise division operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise division.</param>
/// <returns>float4x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator / (float lhs, float4x4 rhs) { return new float4x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise modulus.</param>
/// <returns>float4x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator % (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
/// <returns>float4x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator % (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise modulus.</param>
/// <returns>float4x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator % (float lhs, float4x4 rhs) { return new float4x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
/// <summary>Returns the result of a componentwise increment operation on a float4x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>float4x4 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator ++ (float4x4 val) { return new float4x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
/// <summary>Returns the result of a componentwise decrement operation on a float4x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>float4x4 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator -- (float4x4 val) { return new float4x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
/// <summary>Returns the result of a componentwise less than operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise less than.</param>
/// <returns>bool4x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator < (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
/// <summary>Returns the result of a componentwise less than operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
/// <returns>bool4x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator < (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise less than.</param>
/// <returns>bool4x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator < (float lhs, float4x4 rhs) { return new bool4x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise less or equal.</param>
/// <returns>bool4x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator <= (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
/// <returns>bool4x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator <= (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise less or equal.</param>
/// <returns>bool4x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator <= (float lhs, float4x4 rhs) { return new bool4x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise greater than.</param>
/// <returns>bool4x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator > (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
/// <returns>bool4x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator > (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise greater than.</param>
/// <returns>bool4x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator > (float lhs, float4x4 rhs) { return new bool4x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator >= (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
/// <returns>bool4x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator >= (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool4x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator >= (float lhs, float4x4 rhs) { return new bool4x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
/// <summary>Returns the result of a componentwise unary minus operation on a float4x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>float4x4 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator - (float4x4 val) { return new float4x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
/// <summary>Returns the result of a componentwise unary plus operation on a float4x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>float4x4 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 operator + (float4x4 val) { return new float4x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
/// <summary>Returns the result of a componentwise equality operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise equality.</param>
/// <returns>bool4x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator == (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
/// <returns>bool4x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator == (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise equality.</param>
/// <returns>bool4x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator == (float lhs, float4x4 rhs) { return new bool4x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two float4x4 matrices.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise not equal.</param>
/// <returns>bool4x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator != (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on a float4x4 matrix and a float value.</summary>
/// <param name="lhs">Left hand side float4x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
/// <returns>bool4x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator != (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a float value and a float4x4 matrix.</summary>
/// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side float4x4 to use to compute componentwise not equal.</param>
/// <returns>bool4x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool4x4 operator != (float lhs, float4x4 rhs) { return new bool4x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the float4 element at a specified index.</summary>
unsafe public ref float4 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (float4x4* array = &this) { return ref ((float4*)array)[index]; }
}
}
/// <summary>Returns true if the float4x4 is equal to a given float4x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(float4x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the float4x4 is equal to a given float4x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is float4x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the float4x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the float4x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("float4x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f, {12}f, {13}f, {14}f, {15}f)", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z, c0.w, c1.w, c2.w, c3.w);
}
/// <summary>Returns a string representation of the float4x4 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("float4x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f, {12}f, {13}f, {14}f, {15}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider), c3.w.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a float4x4 matrix constructed from four float4 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>float4x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(float4 c0, float4 c1, float4 c2, float4 c3) { return new float4x4(c0, c1, c2, c3); }
/// <summary>Returns a float4x4 matrix constructed from from 16 float values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
/// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
/// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
/// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
/// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
/// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
/// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
/// <param name="m33">The matrix at row 3, column 3 will be set to this value.</param>
/// <returns>float4x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23,
float m30, float m31, float m32, float m33)
{
return new float4x4(m00, m01, m02, m03,
m10, m11, m12, m13,
m20, m21, m22, m23,
m30, m31, m32, m33);
}
/// <summary>Returns a float4x4 matrix constructed from a single float value by assigning it to every component.</summary>
/// <param name="v">float to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(float v) { return new float4x4(v); }
/// <summary>Returns a float4x4 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
/// <param name="v">bool to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(bool v) { return new float4x4(v); }
/// <summary>Return a float4x4 matrix constructed from a bool4x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool4x4 to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(bool4x4 v) { return new float4x4(v); }
/// <summary>Returns a float4x4 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
/// <param name="v">int to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(int v) { return new float4x4(v); }
/// <summary>Return a float4x4 matrix constructed from a int4x4 matrix by componentwise conversion.</summary>
/// <param name="v">int4x4 to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(int4x4 v) { return new float4x4(v); }
/// <summary>Returns a float4x4 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
/// <param name="v">uint to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(uint v) { return new float4x4(v); }
/// <summary>Return a float4x4 matrix constructed from a uint4x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint4x4 to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(uint4x4 v) { return new float4x4(v); }
/// <summary>Returns a float4x4 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
/// <param name="v">double to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(double v) { return new float4x4(v); }
/// <summary>Return a float4x4 matrix constructed from a double4x4 matrix by componentwise conversion.</summary>
/// <param name="v">double4x4 to convert to float4x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 float4x4(double4x4 v) { return new float4x4(v); }
/// <summary>Return the result of rotating a float3 vector by a float4x4 matrix</summary>
/// <param name ="a">Left hand side matrix argument that specifies the rotation.</param>
/// <param name ="b">Right hand side vector argument to be rotated.</param>
/// <returns>The rotated vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3 rotate(float4x4 a, float3 b)
{
return (a.c0 * b.x + a.c1 * b.y + a.c2 * b.z).xyz;
}
/// <summary>Return the result of transforming a float3 point by a float4x4 matrix</summary>
/// <param name ="a">Left hand side matrix argument that specifies the transformation.</param>
/// <param name ="b">Right hand side point argument to be transformed.</param>
/// <returns>The transformed point.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3 transform(float4x4 a, float3 b)
{
return (a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3).xyz;
}
/// <summary>Return the float4x4 transpose of a float4x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float4x4 transpose(float4x4 v)
{
return float4x4(
v.c0.x, v.c0.y, v.c0.z, v.c0.w,
v.c1.x, v.c1.y, v.c1.z, v.c1.w,
v.c2.x, v.c2.y, v.c2.z, v.c2.w,
v.c3.x, v.c3.y, v.c3.z, v.c3.w);
}
/// <summary>Returns the float4x4 full inverse of a float4x4 matrix.</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
public static float4x4 inverse(float4x4 m)
{
float4 c0 = m.c0;
float4 c1 = m.c1;
float4 c2 = m.c2;
float4 c3 = m.c3;
float4 r0y_r1y_r0x_r1x = movelh(c1, c0);
float4 r0z_r1z_r0w_r1w = movelh(c2, c3);
float4 r2y_r3y_r2x_r3x = movehl(c0, c1);
float4 r2z_r3z_r2w_r3w = movehl(c3, c2);
float4 r1y_r2y_r1x_r2x = shuffle(c1, c0, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ);
float4 r1z_r2z_r1w_r2w = shuffle(c2, c3, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ);
float4 r3y_r0y_r3x_r0x = shuffle(c1, c0, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX);
float4 r3z_r0z_r3w_r0w = shuffle(c2, c3, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX);
float4 r0_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ);
float4 r1_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW);
float4 r2_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ);
float4 r3_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW);
float4 r0_xyzw = shuffle(r0y_r1y_r0x_r1x, r0z_r1z_r0w_r1w, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ);
// Calculate remaining inner term pairs. inner terms have zw=-xy, so we only have to calculate xy and can pack two pairs per vector.
float4 inner12_23 = r1y_r2y_r1x_r2x * r2z_r3z_r2w_r3w - r1z_r2z_r1w_r2w * r2y_r3y_r2x_r3x;
float4 inner02_13 = r0y_r1y_r0x_r1x * r2z_r3z_r2w_r3w - r0z_r1z_r0w_r1w * r2y_r3y_r2x_r3x;
float4 inner30_01 = r3z_r0z_r3w_r0w * r0y_r1y_r0x_r1x - r3y_r0y_r3x_r0x * r0z_r1z_r0w_r1w;
// Expand inner terms back to 4 components. zw signs still need to be flipped
float4 inner12 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX);
float4 inner23 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY);
float4 inner02 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX);
float4 inner13 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY);
// Calculate minors
float4 minors0 = r3_wzyx * inner12 - r2_wzyx * inner13 + r1_wzyx * inner23;
float4 denom = r0_xyzw * minors0;
// Horizontal sum of denominator. Free sign flip of z and w compensates for missing flip in inner terms.
denom = denom + shuffle(denom, denom, ShuffleComponent.LeftY, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightZ); // x+y x+y z+w z+w
denom = denom - shuffle(denom, denom, ShuffleComponent.LeftZ, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.RightX); // x+y-z-w x+y-z-w z+w-x-y z+w-x-y
float4 rcp_denom_ppnn = float4(1.0f) / denom;
float4x4 res;
res.c0 = minors0 * rcp_denom_ppnn;
float4 inner30 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX);
float4 inner01 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY);
float4 minors1 = r2_wzyx * inner30 - r0_wzyx * inner23 - r3_wzyx * inner02;
res.c1 = minors1 * rcp_denom_ppnn;
float4 minors2 = r0_wzyx * inner13 - r1_wzyx * inner30 - r3_wzyx * inner01;
res.c2 = minors2 * rcp_denom_ppnn;
float4 minors3 = r1_wzyx * inner02 - r0_wzyx * inner12 + r2_wzyx * inner01;
res.c3 = minors3 * rcp_denom_ppnn;
return res;
}
/// <summary>Fast matrix inverse for rigid transforms (orthonormal basis and translation)</summary>
/// <param name="m">Matrix to invert.</param>
/// <returns>The inverted matrix.</returns>
public static float4x4 fastinverse(float4x4 m)
{
float4 c0 = m.c0;
float4 c1 = m.c1;
float4 c2 = m.c2;
float4 pos = m.c3;
float4 zero = float4(0);
float4 t0 = unpacklo(c0, c2);
float4 t1 = unpacklo(c1, zero);
float4 t2 = unpackhi(c0, c2);
float4 t3 = unpackhi(c1, zero);
float4 r0 = unpacklo(t0, t1);
float4 r1 = unpackhi(t0, t1);
float4 r2 = unpacklo(t2, t3);
pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z);
pos.w = 1.0f;
return float4x4(r0, r1, r2, pos);
}
/// <summary>Returns the determinant of a float4x4 matrix.</summary>
/// <param name="m">Matrix to use when computing determinant.</param>
/// <returns>The determinant of the matrix.</returns>
public static float determinant(float4x4 m)
{
float4 c0 = m.c0;
float4 c1 = m.c1;
float4 c2 = m.c2;
float4 c3 = m.c3;
float m00 = c1.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c1.z * c3.w - c1.w * c3.z) + c3.y * (c1.z * c2.w - c1.w * c2.z);
float m01 = c0.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c2.w - c0.w * c2.z);
float m02 = c0.y * (c1.z * c3.w - c1.w * c3.z) - c1.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c1.w - c0.w * c1.z);
float m03 = c0.y * (c1.z * c2.w - c1.w * c2.z) - c1.y * (c0.z * c2.w - c0.w * c2.z) + c2.y * (c0.z * c1.w - c0.w * c1.z);
return c0.x * m00 - c1.x * m01 + c2.x * m02 - c3.x * m03;
}
/// <summary>Returns a uint hash code of a float4x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(float4x4 v)
{
return csum(asuint(v.c0) * uint4(0xC4B1493Fu, 0xBA0966D3u, 0xAFBEE253u, 0x5B419C01u) +
asuint(v.c1) * uint4(0x515D90F5u, 0xEC9F68F3u, 0xF9EA92D5u, 0xC2FAFCB9u) +
asuint(v.c2) * uint4(0x616E9CA1u, 0xC5C5394Bu, 0xCAE78587u, 0x7A1541C9u) +
asuint(v.c3) * uint4(0xF83BD927u, 0x6A243BCBu, 0x509B84C9u, 0x91D13847u)) + 0x52F7230Fu;
}
/// <summary>
/// Returns a uint4 vector hash code of a float4x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint4 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint4 hashwide(float4x4 v)
{
return (asuint(v.c0) * uint4(0xCF286E83u, 0xE121E6ADu, 0xC9CA1249u, 0x69B60C81u) +
asuint(v.c1) * uint4(0xE0EB6C25u, 0xF648BEABu, 0x6BDB2B07u, 0xEF63C699u) +
asuint(v.c2) * uint4(0x9001903Fu, 0xA895B9CDu, 0x9D23B201u, 0x4B01D3E1u) +
asuint(v.c3) * uint4(0x7461CA0Du, 0x79725379u, 0xD6258E5Bu, 0xEE390C97u)) + 0x9C8A2F05u;
}
}
}

170
ThirdParty/Unity.Mathematics/half.cs vendored Normal file
View File

@@ -0,0 +1,170 @@
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
namespace Unity.Mathematics
{
/// <summary>
/// A half precision float that uses 16 bits instead of 32 bits.
/// </summary>
[Il2CppEagerStaticClassConstruction]
[Serializable]
public struct half : System.IEquatable<half>, IFormattable
{
/// <summary>
/// The raw 16 bit value of the half.
/// </summary>
public ushort value;
/// <summary>half zero value.</summary>
public static readonly half zero = new half();
/// <summary>
/// The maximum finite half value as a single precision float.
/// </summary>
public static float MaxValue { get { return 65504.0f; } }
/// <summary>
/// The minimum finite half value as a single precision float.
/// </summary>
public static float MinValue { get { return -65504.0f; } }
/// <summary>
/// The maximum finite half value as a half.
/// </summary>
public static half MaxValueAsHalf => new half(MaxValue);
/// <summary>
/// The minimum finite half value as a half.
/// </summary>
public static half MinValueAsHalf => new half(MinValue);
/// <summary>Constructs a half value from a half value.</summary>
/// <param name="x">The input half value to copy.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half(half x)
{
value = x.value;
}
/// <summary>Constructs a half value from a float value.</summary>
/// <param name="v">The single precision float value to convert to half.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half(float v)
{
value = (ushort)math.f32tof16(v);
}
/// <summary>Constructs a half value from a double value.</summary>
/// <param name="v">The double precision float value to convert to half.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half(double v)
{
value = (ushort)math.f32tof16((float)v);
}
/// <summary>Explicitly converts a float value to a half value.</summary>
/// <param name="v">The single precision float value to convert to half.</param>
/// <returns>The converted half value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator half(float v) { return new half(v); }
/// <summary>Explicitly converts a double value to a half value.</summary>
/// <param name="v">The double precision float value to convert to half.</param>
/// <returns>The converted half value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator half(double v) { return new half(v); }
/// <summary>Implicitly converts a half value to a float value.</summary>
/// <param name="d">The half value to convert to a single precision float.</param>
/// <returns>The converted single precision float value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator float(half d) { return math.f16tof32(d.value); }
/// <summary>Implicitly converts a half value to a double value.</summary>
/// <param name="d">The half value to convert to double precision float.</param>
/// <returns>The converted double precision float value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator double(half d) { return math.f16tof32(d.value); }
/// <summary>Returns whether two half values are bitwise equivalent.</summary>
/// <param name="lhs">Left hand side half value to use in comparison.</param>
/// <param name="rhs">Right hand side half value to use in comparison.</param>
/// <returns>True if the two half values are bitwise equivalent, false otherwise.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(half lhs, half rhs) { return lhs.value == rhs.value; }
/// <summary>Returns whether two half values are not bitwise equivalent.</summary>
/// <param name="lhs">Left hand side half value to use in comparison.</param>
/// <param name="rhs">Right hand side half value to use in comparison.</param>
/// <returns>True if the two half values are not bitwise equivalent, false otherwise.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(half lhs, half rhs) { return lhs.value != rhs.value; }
/// <summary>Returns true if the half is bitwise equivalent to a given half, false otherwise.</summary>
/// <param name="rhs">Right hand side half value to use in comparison.</param>
/// <returns>True if the half value is bitwise equivalent to the input, false otherwise.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(half rhs) { return value == rhs.value; }
/// <summary>Returns true if the half is equal to a given half, false otherwise.</summary>
/// <param name="o">Right hand side object to use in comparison.</param>
/// <returns>True if the object is of type half and is bitwise equivalent, false otherwise.</returns>
public override bool Equals(object o) { return o is half converted && Equals(converted); }
/// <summary>Returns a hash code for the half.</summary>
/// <returns>The computed hash code of the half.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)value; }
/// <summary>Returns a string representation of the half.</summary>
/// <returns>The string representation of the half.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return math.f16tof32(value).ToString();
}
/// <summary>Returns a string representation of the half using a specified format and culture-specific format information.</summary>
/// <param name="format">The format string to use during string formatting.</param>
/// <param name="formatProvider">The format provider to use during string formatting.</param>
/// <returns>The string representation of the half.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return math.f16tof32(value).ToString(format, formatProvider);
}
}
public static partial class math
{
/// <summary>Returns a half value constructed from a half values.</summary>
/// <param name="x">The input half value to copy.</param>
/// <returns>The constructed half value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half half(half x) { return new half(x); }
/// <summary>Returns a half value constructed from a float value.</summary>
/// <param name="v">The single precision float value to convert to half.</param>
/// <returns>The constructed half value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half half(float v) { return new half(v); }
/// <summary>Returns a half value constructed from a double value.</summary>
/// <param name="v">The double precision float value to convert to half.</param>
/// <returns>The constructed half value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half half(double v) { return new half(v); }
/// <summary>Returns a uint hash code of a half value.</summary>
/// <param name="v">The half value to hash.</param>
/// <returns>The computed hash code of the half value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(half v)
{
return v.value * 0x745ED837u + 0x816EFB5Du;
}
}
}

View File

@@ -0,0 +1,569 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using System.Diagnostics;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2 component vector of halfs.</summary>
[DebuggerTypeProxy(typeof(half2.DebuggerProxy))]
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct half2 : System.IEquatable<half2>, IFormattable
{
/// <summary>x component of the vector.</summary>
public half x;
/// <summary>y component of the vector.</summary>
public half y;
/// <summary>half2 zero value.</summary>
public static readonly half2 zero;
/// <summary>Constructs a half2 vector from two half values.</summary>
/// <param name="x">The constructed vector's x component will be set to this value.</param>
/// <param name="y">The constructed vector's y component will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half2(half x, half y)
{
this.x = x;
this.y = y;
}
/// <summary>Constructs a half2 vector from a half2 vector.</summary>
/// <param name="xy">The constructed vector's xy components will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half2(half2 xy)
{
this.x = xy.x;
this.y = xy.y;
}
/// <summary>Constructs a half2 vector from a single half value by assigning it to every component.</summary>
/// <param name="v">half to convert to half2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half2(half v)
{
this.x = v;
this.y = v;
}
/// <summary>Constructs a half2 vector from a single float value by converting it to half and assigning it to every component.</summary>
/// <param name="v">float to convert to half2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half2(float v)
{
this.x = (half)v;
this.y = (half)v;
}
/// <summary>Constructs a half2 vector from a float2 vector by componentwise conversion.</summary>
/// <param name="v">float2 to convert to half2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half2(float2 v)
{
this.x = (half)v.x;
this.y = (half)v.y;
}
/// <summary>Constructs a half2 vector from a single double value by converting it to half and assigning it to every component.</summary>
/// <param name="v">double to convert to half2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half2(double v)
{
this.x = (half)v;
this.y = (half)v;
}
/// <summary>Constructs a half2 vector from a double2 vector by componentwise conversion.</summary>
/// <param name="v">double2 to convert to half2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public half2(double2 v)
{
this.x = (half)v.x;
this.y = (half)v.y;
}
/// <summary>Implicitly converts a single half value to a half2 vector by assigning it to every component.</summary>
/// <param name="v">half to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator half2(half v) { return new half2(v); }
/// <summary>Explicitly converts a single float value to a half2 vector by converting it to half and assigning it to every component.</summary>
/// <param name="v">float to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator half2(float v) { return new half2(v); }
/// <summary>Explicitly converts a float2 vector to a half2 vector by componentwise conversion.</summary>
/// <param name="v">float2 to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator half2(float2 v) { return new half2(v); }
/// <summary>Explicitly converts a single double value to a half2 vector by converting it to half and assigning it to every component.</summary>
/// <param name="v">double to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator half2(double v) { return new half2(v); }
/// <summary>Explicitly converts a double2 vector to a half2 vector by componentwise conversion.</summary>
/// <param name="v">double2 to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator half2(double2 v) { return new half2(v); }
/// <summary>Returns the result of a componentwise equality operation on two half2 vectors.</summary>
/// <param name="lhs">Left hand side half2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side half2 to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (half2 lhs, half2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); }
/// <summary>Returns the result of a componentwise equality operation on a half2 vector and a half value.</summary>
/// <param name="lhs">Left hand side half2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side half to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (half2 lhs, half rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); }
/// <summary>Returns the result of a componentwise equality operation on a half value and a half2 vector.</summary>
/// <param name="lhs">Left hand side half to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side half2 to use to compute componentwise equality.</param>
/// <returns>bool2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator == (half lhs, half2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); }
/// <summary>Returns the result of a componentwise not equal operation on two half2 vectors.</summary>
/// <param name="lhs">Left hand side half2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side half2 to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (half2 lhs, half2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); }
/// <summary>Returns the result of a componentwise not equal operation on a half2 vector and a half value.</summary>
/// <param name="lhs">Left hand side half2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side half to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (half2 lhs, half rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on a half value and a half2 vector.</summary>
/// <param name="lhs">Left hand side half to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side half2 to use to compute componentwise not equal.</param>
/// <returns>bool2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator != (half lhs, half2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); }
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 xxxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(x, x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 xxxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(x, x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 xxyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(x, x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 xxyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(x, x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 xyxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(x, y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 xyxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(x, y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 xyyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(x, y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 xyyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(x, y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 yxxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(y, x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 yxxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(y, x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 yxyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(y, x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 yxyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(y, x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 yyxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(y, y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 yyxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(y, y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 yyyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(y, y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half4 yyyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half4(y, y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half3 xxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half3(x, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half3 xxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half3(x, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half3 xyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half3(x, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half3 xyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half3(x, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half3 yxx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half3(y, x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half3 yxy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half3(y, x, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half3 yyx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half3(y, y, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half3 yyy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half3(y, y, y); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half2 xx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half2(x, x); }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half2 xy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half2(x, y); }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
set { x = value.x; y = value.y; }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half2 yx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half2(y, x); }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
set { y = value.x; x = value.y; }
}
/// <summary>Swizzles the vector.</summary>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public half2 yy
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return new half2(y, y); }
}
/// <summary>Returns the half element at a specified index.</summary>
unsafe public half this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (half2* array = &this) { return ((half*)array)[index]; }
}
set
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (half* array = &x) { array[index] = value; }
}
}
/// <summary>Returns true if the half2 is equal to a given half2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(half2 rhs) { return x == rhs.x && y == rhs.y; }
/// <summary>Returns true if the half2 is equal to a given half2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is half2 converted && Equals(converted); }
/// <summary>Returns a hash code for the half2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the half2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("half2({0}, {1})", x, y);
}
/// <summary>Returns a string representation of the half2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("half2({0}, {1})", x.ToString(format, formatProvider), y.ToString(format, formatProvider));
}
internal sealed class DebuggerProxy
{
public half x;
public half y;
public DebuggerProxy(half2 v)
{
x = v.x;
y = v.y;
}
}
}
public static partial class math
{
/// <summary>Returns a half2 vector constructed from two half values.</summary>
/// <param name="x">The constructed vector's x component will be set to this value.</param>
/// <param name="y">The constructed vector's y component will be set to this value.</param>
/// <returns>half2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half2 half2(half x, half y) { return new half2(x, y); }
/// <summary>Returns a half2 vector constructed from a half2 vector.</summary>
/// <param name="xy">The constructed vector's xy components will be set to this value.</param>
/// <returns>half2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half2 half2(half2 xy) { return new half2(xy); }
/// <summary>Returns a half2 vector constructed from a single half value by assigning it to every component.</summary>
/// <param name="v">half to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half2 half2(half v) { return new half2(v); }
/// <summary>Returns a half2 vector constructed from a single float value by converting it to half and assigning it to every component.</summary>
/// <param name="v">float to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half2 half2(float v) { return new half2(v); }
/// <summary>Return a half2 vector constructed from a float2 vector by componentwise conversion.</summary>
/// <param name="v">float2 to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half2 half2(float2 v) { return new half2(v); }
/// <summary>Returns a half2 vector constructed from a single double value by converting it to half and assigning it to every component.</summary>
/// <param name="v">double to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half2 half2(double v) { return new half2(v); }
/// <summary>Return a half2 vector constructed from a double2 vector by componentwise conversion.</summary>
/// <param name="v">double2 to convert to half2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static half2 half2(double2 v) { return new half2(v); }
/// <summary>Returns a uint hash code of a half2 vector.</summary>
/// <param name="v">Vector value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(half2 v)
{
return csum(uint2(v.x.value, v.y.value) * uint2(0x6E624EB7u, 0x7383ED49u)) + 0xDD49C23Bu;
}
/// <summary>
/// Returns a uint2 vector hash code of a half2 vector.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Vector value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(half2 v)
{
return (uint2(v.x.value, v.y.value) * uint2(0xEBD0D005u, 0x91475DF7u)) + 0x55E84827u;
}
}
}

1439
ThirdParty/Unity.Mathematics/half3.gen.cs vendored Normal file

File diff suppressed because it is too large Load Diff

3603
ThirdParty/Unity.Mathematics/half4.gen.cs vendored Normal file

File diff suppressed because it is too large Load Diff

1043
ThirdParty/Unity.Mathematics/int2.gen.cs vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,729 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x2 matrix of ints.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct int2x2 : System.IEquatable<int2x2>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public int2 c0;
/// <summary>Column 1 of the matrix.</summary>
public int2 c1;
/// <summary>int2x2 identity transform.</summary>
public static readonly int2x2 identity = new int2x2(1, 0, 0, 1);
/// <summary>int2x2 zero value.</summary>
public static readonly int2x2 zero;
/// <summary>Constructs a int2x2 matrix from two int2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(int2 c0, int2 c1)
{
this.c0 = c0;
this.c1 = c1;
}
/// <summary>Constructs a int2x2 matrix from 4 int values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(int m00, int m01,
int m10, int m11)
{
this.c0 = new int2(m00, m10);
this.c1 = new int2(m01, m11);
}
/// <summary>Constructs a int2x2 matrix from a single int value by assigning it to every component.</summary>
/// <param name="v">int to convert to int2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(int v)
{
this.c0 = v;
this.c1 = v;
}
/// <summary>Constructs a int2x2 matrix from a single bool value by converting it to int and assigning it to every component.</summary>
/// <param name="v">bool to convert to int2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(bool v)
{
this.c0 = math.select(new int2(0), new int2(1), v);
this.c1 = math.select(new int2(0), new int2(1), v);
}
/// <summary>Constructs a int2x2 matrix from a bool2x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x2 to convert to int2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(bool2x2 v)
{
this.c0 = math.select(new int2(0), new int2(1), v.c0);
this.c1 = math.select(new int2(0), new int2(1), v.c1);
}
/// <summary>Constructs a int2x2 matrix from a single uint value by converting it to int and assigning it to every component.</summary>
/// <param name="v">uint to convert to int2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(uint v)
{
this.c0 = (int2)v;
this.c1 = (int2)v;
}
/// <summary>Constructs a int2x2 matrix from a uint2x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x2 to convert to int2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(uint2x2 v)
{
this.c0 = (int2)v.c0;
this.c1 = (int2)v.c1;
}
/// <summary>Constructs a int2x2 matrix from a single float value by converting it to int and assigning it to every component.</summary>
/// <param name="v">float to convert to int2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(float v)
{
this.c0 = (int2)v;
this.c1 = (int2)v;
}
/// <summary>Constructs a int2x2 matrix from a float2x2 matrix by componentwise conversion.</summary>
/// <param name="v">float2x2 to convert to int2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(float2x2 v)
{
this.c0 = (int2)v.c0;
this.c1 = (int2)v.c1;
}
/// <summary>Constructs a int2x2 matrix from a single double value by converting it to int and assigning it to every component.</summary>
/// <param name="v">double to convert to int2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(double v)
{
this.c0 = (int2)v;
this.c1 = (int2)v;
}
/// <summary>Constructs a int2x2 matrix from a double2x2 matrix by componentwise conversion.</summary>
/// <param name="v">double2x2 to convert to int2x2</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x2(double2x2 v)
{
this.c0 = (int2)v.c0;
this.c1 = (int2)v.c1;
}
/// <summary>Implicitly converts a single int value to a int2x2 matrix by assigning it to every component.</summary>
/// <param name="v">int to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator int2x2(int v) { return new int2x2(v); }
/// <summary>Explicitly converts a single bool value to a int2x2 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">bool to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x2(bool v) { return new int2x2(v); }
/// <summary>Explicitly converts a bool2x2 matrix to a int2x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x2 to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x2(bool2x2 v) { return new int2x2(v); }
/// <summary>Explicitly converts a single uint value to a int2x2 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">uint to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x2(uint v) { return new int2x2(v); }
/// <summary>Explicitly converts a uint2x2 matrix to a int2x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x2 to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x2(uint2x2 v) { return new int2x2(v); }
/// <summary>Explicitly converts a single float value to a int2x2 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">float to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x2(float v) { return new int2x2(v); }
/// <summary>Explicitly converts a float2x2 matrix to a int2x2 matrix by componentwise conversion.</summary>
/// <param name="v">float2x2 to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x2(float2x2 v) { return new int2x2(v); }
/// <summary>Explicitly converts a single double value to a int2x2 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">double to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x2(double v) { return new int2x2(v); }
/// <summary>Explicitly converts a double2x2 matrix to a int2x2 matrix by componentwise conversion.</summary>
/// <param name="v">double2x2 to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x2(double2x2 v) { return new int2x2(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise multiplication.</param>
/// <returns>int2x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator * (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
/// <summary>Returns the result of a componentwise multiplication operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise multiplication.</param>
/// <returns>int2x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator * (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise multiplication.</param>
/// <returns>int2x2 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator * (int lhs, int2x2 rhs) { return new int2x2 (lhs * rhs.c0, lhs * rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise addition.</param>
/// <returns>int2x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator + (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
/// <summary>Returns the result of a componentwise addition operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise addition.</param>
/// <returns>int2x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator + (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise addition.</param>
/// <returns>int2x2 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator + (int lhs, int2x2 rhs) { return new int2x2 (lhs + rhs.c0, lhs + rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise subtraction.</param>
/// <returns>int2x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator - (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
/// <summary>Returns the result of a componentwise subtraction operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise subtraction.</param>
/// <returns>int2x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator - (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise subtraction.</param>
/// <returns>int2x2 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator - (int lhs, int2x2 rhs) { return new int2x2 (lhs - rhs.c0, lhs - rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise division.</param>
/// <returns>int2x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator / (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
/// <summary>Returns the result of a componentwise division operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise division.</param>
/// <returns>int2x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator / (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
/// <summary>Returns the result of a componentwise division operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise division.</param>
/// <returns>int2x2 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator / (int lhs, int2x2 rhs) { return new int2x2 (lhs / rhs.c0, lhs / rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise modulus.</param>
/// <returns>int2x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator % (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
/// <summary>Returns the result of a componentwise modulus operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise modulus.</param>
/// <returns>int2x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator % (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise modulus.</param>
/// <returns>int2x2 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator % (int lhs, int2x2 rhs) { return new int2x2 (lhs % rhs.c0, lhs % rhs.c1); }
/// <summary>Returns the result of a componentwise increment operation on an int2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>int2x2 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator ++ (int2x2 val) { return new int2x2 (++val.c0, ++val.c1); }
/// <summary>Returns the result of a componentwise decrement operation on an int2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>int2x2 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator -- (int2x2 val) { return new int2x2 (--val.c0, --val.c1); }
/// <summary>Returns the result of a componentwise less than operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise less than.</param>
/// <returns>bool2x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator < (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
/// <summary>Returns the result of a componentwise less than operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise less than.</param>
/// <returns>bool2x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator < (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise less than.</param>
/// <returns>bool2x2 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator < (int lhs, int2x2 rhs) { return new bool2x2 (lhs < rhs.c0, lhs < rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise less or equal.</param>
/// <returns>bool2x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator <= (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
/// <summary>Returns the result of a componentwise less or equal operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise less or equal.</param>
/// <returns>bool2x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator <= (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise less or equal.</param>
/// <returns>bool2x2 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator <= (int lhs, int2x2 rhs) { return new bool2x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise greater than.</param>
/// <returns>bool2x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator > (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
/// <summary>Returns the result of a componentwise greater than operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise greater than.</param>
/// <returns>bool2x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator > (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise greater than.</param>
/// <returns>bool2x2 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator > (int lhs, int2x2 rhs) { return new bool2x2 (lhs > rhs.c0, lhs > rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator >= (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
/// <summary>Returns the result of a componentwise greater or equal operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise greater or equal.</param>
/// <returns>bool2x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator >= (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x2 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator >= (int lhs, int2x2 rhs) { return new bool2x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
/// <summary>Returns the result of a componentwise unary minus operation on an int2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>int2x2 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator - (int2x2 val) { return new int2x2 (-val.c0, -val.c1); }
/// <summary>Returns the result of a componentwise unary plus operation on an int2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>int2x2 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator + (int2x2 val) { return new int2x2 (+val.c0, +val.c1); }
/// <summary>Returns the result of a componentwise left shift operation on an int2x2 matrix by a number of bits specified by a single int.</summary>
/// <param name="x">The matrix to left shift.</param>
/// <param name="n">The number of bits to left shift.</param>
/// <returns>The result of the componentwise left shift.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator << (int2x2 x, int n) { return new int2x2 (x.c0 << n, x.c1 << n); }
/// <summary>Returns the result of a componentwise right shift operation on an int2x2 matrix by a number of bits specified by a single int.</summary>
/// <param name="x">The matrix to right shift.</param>
/// <param name="n">The number of bits to right shift.</param>
/// <returns>The result of the componentwise right shift.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator >> (int2x2 x, int n) { return new int2x2 (x.c0 >> n, x.c1 >> n); }
/// <summary>Returns the result of a componentwise equality operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
/// <summary>Returns the result of a componentwise equality operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise equality.</param>
/// <returns>bool2x2 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator == (int lhs, int2x2 rhs) { return new bool2x2 (lhs == rhs.c0, lhs == rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
/// <summary>Returns the result of a componentwise not equal operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise not equal.</param>
/// <returns>bool2x2 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x2 operator != (int lhs, int2x2 rhs) { return new bool2x2 (lhs != rhs.c0, lhs != rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise not operation on an int2x2 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise bitwise not.</param>
/// <returns>int2x2 result of the componentwise bitwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator ~ (int2x2 val) { return new int2x2 (~val.c0, ~val.c1); }
/// <summary>Returns the result of a componentwise bitwise and operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise bitwise and.</param>
/// <returns>int2x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator & (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise and operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise bitwise and.</param>
/// <returns>int2x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator & (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 & rhs, lhs.c1 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise bitwise and.</param>
/// <returns>int2x2 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator & (int lhs, int2x2 rhs) { return new int2x2 (lhs & rhs.c0, lhs & rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise or operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise bitwise or.</param>
/// <returns>int2x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator | (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise or operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise bitwise or.</param>
/// <returns>int2x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator | (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 | rhs, lhs.c1 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise bitwise or.</param>
/// <returns>int2x2 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator | (int lhs, int2x2 rhs) { return new int2x2 (lhs | rhs.c0, lhs | rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two int2x2 matrices.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>int2x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator ^ (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int2x2 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x2 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise bitwise exclusive or.</param>
/// <returns>int2x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator ^ (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int value and an int2x2 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side int2x2 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>int2x2 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 operator ^ (int lhs, int2x2 rhs) { return new int2x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); }
/// <summary>Returns the int2 element at a specified index.</summary>
unsafe public ref int2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 2)
throw new System.ArgumentException("index must be between[0...1]");
#endif
fixed (int2x2* array = &this) { return ref ((int2*)array)[index]; }
}
}
/// <summary>Returns true if the int2x2 is equal to a given int2x2, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(int2x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
/// <summary>Returns true if the int2x2 is equal to a given int2x2, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is int2x2 converted && Equals(converted); }
/// <summary>Returns a hash code for the int2x2.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the int2x2.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("int2x2({0}, {1}, {2}, {3})", c0.x, c1.x, c0.y, c1.y);
}
/// <summary>Returns a string representation of the int2x2 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("int2x2({0}, {1}, {2}, {3})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a int2x2 matrix constructed from two int2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <returns>int2x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(int2 c0, int2 c1) { return new int2x2(c0, c1); }
/// <summary>Returns a int2x2 matrix constructed from from 4 int values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <returns>int2x2 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(int m00, int m01,
int m10, int m11)
{
return new int2x2(m00, m01,
m10, m11);
}
/// <summary>Returns a int2x2 matrix constructed from a single int value by assigning it to every component.</summary>
/// <param name="v">int to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(int v) { return new int2x2(v); }
/// <summary>Returns a int2x2 matrix constructed from a single bool value by converting it to int and assigning it to every component.</summary>
/// <param name="v">bool to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(bool v) { return new int2x2(v); }
/// <summary>Return a int2x2 matrix constructed from a bool2x2 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x2 to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(bool2x2 v) { return new int2x2(v); }
/// <summary>Returns a int2x2 matrix constructed from a single uint value by converting it to int and assigning it to every component.</summary>
/// <param name="v">uint to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(uint v) { return new int2x2(v); }
/// <summary>Return a int2x2 matrix constructed from a uint2x2 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x2 to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(uint2x2 v) { return new int2x2(v); }
/// <summary>Returns a int2x2 matrix constructed from a single float value by converting it to int and assigning it to every component.</summary>
/// <param name="v">float to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(float v) { return new int2x2(v); }
/// <summary>Return a int2x2 matrix constructed from a float2x2 matrix by componentwise conversion.</summary>
/// <param name="v">float2x2 to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(float2x2 v) { return new int2x2(v); }
/// <summary>Returns a int2x2 matrix constructed from a single double value by converting it to int and assigning it to every component.</summary>
/// <param name="v">double to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(double v) { return new int2x2(v); }
/// <summary>Return a int2x2 matrix constructed from a double2x2 matrix by componentwise conversion.</summary>
/// <param name="v">double2x2 to convert to int2x2</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 int2x2(double2x2 v) { return new int2x2(v); }
/// <summary>Return the int2x2 transpose of a int2x2 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x2 transpose(int2x2 v)
{
return int2x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y);
}
/// <summary>Returns the determinant of a int2x2 matrix.</summary>
/// <param name="m">Matrix to use when computing determinant.</param>
/// <returns>The determinant of the matrix.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int determinant(int2x2 m)
{
int a = m.c0.x;
int b = m.c1.x;
int c = m.c0.y;
int d = m.c1.y;
return a * d - b * c;
}
/// <summary>Returns a uint hash code of a int2x2 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(int2x2 v)
{
return csum(asuint(v.c0) * uint2(0xE191B035u, 0x68586FAFu) +
asuint(v.c1) * uint2(0xD4DFF6D3u, 0xCB634F4Du)) + 0x9B13B92Du;
}
/// <summary>
/// Returns a uint2 vector hash code of a int2x2 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(int2x2 v)
{
return (asuint(v.c0) * uint2(0x4ABF0813u, 0x86068063u) +
asuint(v.c1) * uint2(0xD75513F9u, 0x5AB3E8CDu)) + 0x676E8407u;
}
}
}

View File

@@ -0,0 +1,734 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x3 matrix of ints.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct int2x3 : System.IEquatable<int2x3>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public int2 c0;
/// <summary>Column 1 of the matrix.</summary>
public int2 c1;
/// <summary>Column 2 of the matrix.</summary>
public int2 c2;
/// <summary>int2x3 zero value.</summary>
public static readonly int2x3 zero;
/// <summary>Constructs a int2x3 matrix from three int2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(int2 c0, int2 c1, int2 c2)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
}
/// <summary>Constructs a int2x3 matrix from 6 int values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(int m00, int m01, int m02,
int m10, int m11, int m12)
{
this.c0 = new int2(m00, m10);
this.c1 = new int2(m01, m11);
this.c2 = new int2(m02, m12);
}
/// <summary>Constructs a int2x3 matrix from a single int value by assigning it to every component.</summary>
/// <param name="v">int to convert to int2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
}
/// <summary>Constructs a int2x3 matrix from a single bool value by converting it to int and assigning it to every component.</summary>
/// <param name="v">bool to convert to int2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(bool v)
{
this.c0 = math.select(new int2(0), new int2(1), v);
this.c1 = math.select(new int2(0), new int2(1), v);
this.c2 = math.select(new int2(0), new int2(1), v);
}
/// <summary>Constructs a int2x3 matrix from a bool2x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x3 to convert to int2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(bool2x3 v)
{
this.c0 = math.select(new int2(0), new int2(1), v.c0);
this.c1 = math.select(new int2(0), new int2(1), v.c1);
this.c2 = math.select(new int2(0), new int2(1), v.c2);
}
/// <summary>Constructs a int2x3 matrix from a single uint value by converting it to int and assigning it to every component.</summary>
/// <param name="v">uint to convert to int2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(uint v)
{
this.c0 = (int2)v;
this.c1 = (int2)v;
this.c2 = (int2)v;
}
/// <summary>Constructs a int2x3 matrix from a uint2x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x3 to convert to int2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(uint2x3 v)
{
this.c0 = (int2)v.c0;
this.c1 = (int2)v.c1;
this.c2 = (int2)v.c2;
}
/// <summary>Constructs a int2x3 matrix from a single float value by converting it to int and assigning it to every component.</summary>
/// <param name="v">float to convert to int2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(float v)
{
this.c0 = (int2)v;
this.c1 = (int2)v;
this.c2 = (int2)v;
}
/// <summary>Constructs a int2x3 matrix from a float2x3 matrix by componentwise conversion.</summary>
/// <param name="v">float2x3 to convert to int2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(float2x3 v)
{
this.c0 = (int2)v.c0;
this.c1 = (int2)v.c1;
this.c2 = (int2)v.c2;
}
/// <summary>Constructs a int2x3 matrix from a single double value by converting it to int and assigning it to every component.</summary>
/// <param name="v">double to convert to int2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(double v)
{
this.c0 = (int2)v;
this.c1 = (int2)v;
this.c2 = (int2)v;
}
/// <summary>Constructs a int2x3 matrix from a double2x3 matrix by componentwise conversion.</summary>
/// <param name="v">double2x3 to convert to int2x3</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x3(double2x3 v)
{
this.c0 = (int2)v.c0;
this.c1 = (int2)v.c1;
this.c2 = (int2)v.c2;
}
/// <summary>Implicitly converts a single int value to a int2x3 matrix by assigning it to every component.</summary>
/// <param name="v">int to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator int2x3(int v) { return new int2x3(v); }
/// <summary>Explicitly converts a single bool value to a int2x3 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">bool to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x3(bool v) { return new int2x3(v); }
/// <summary>Explicitly converts a bool2x3 matrix to a int2x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x3 to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x3(bool2x3 v) { return new int2x3(v); }
/// <summary>Explicitly converts a single uint value to a int2x3 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">uint to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x3(uint v) { return new int2x3(v); }
/// <summary>Explicitly converts a uint2x3 matrix to a int2x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x3 to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x3(uint2x3 v) { return new int2x3(v); }
/// <summary>Explicitly converts a single float value to a int2x3 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">float to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x3(float v) { return new int2x3(v); }
/// <summary>Explicitly converts a float2x3 matrix to a int2x3 matrix by componentwise conversion.</summary>
/// <param name="v">float2x3 to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x3(float2x3 v) { return new int2x3(v); }
/// <summary>Explicitly converts a single double value to a int2x3 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">double to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x3(double v) { return new int2x3(v); }
/// <summary>Explicitly converts a double2x3 matrix to a int2x3 matrix by componentwise conversion.</summary>
/// <param name="v">double2x3 to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x3(double2x3 v) { return new int2x3(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise multiplication.</param>
/// <returns>int2x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator * (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); }
/// <summary>Returns the result of a componentwise multiplication operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise multiplication.</param>
/// <returns>int2x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator * (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise multiplication.</param>
/// <returns>int2x3 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator * (int lhs, int2x3 rhs) { return new int2x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise addition.</param>
/// <returns>int2x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator + (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); }
/// <summary>Returns the result of a componentwise addition operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise addition.</param>
/// <returns>int2x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator + (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise addition.</param>
/// <returns>int2x3 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator + (int lhs, int2x3 rhs) { return new int2x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise subtraction.</param>
/// <returns>int2x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator - (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); }
/// <summary>Returns the result of a componentwise subtraction operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise subtraction.</param>
/// <returns>int2x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator - (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise subtraction.</param>
/// <returns>int2x3 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator - (int lhs, int2x3 rhs) { return new int2x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise division.</param>
/// <returns>int2x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator / (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); }
/// <summary>Returns the result of a componentwise division operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise division.</param>
/// <returns>int2x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator / (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); }
/// <summary>Returns the result of a componentwise division operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise division.</param>
/// <returns>int2x3 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator / (int lhs, int2x3 rhs) { return new int2x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise modulus.</param>
/// <returns>int2x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator % (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); }
/// <summary>Returns the result of a componentwise modulus operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise modulus.</param>
/// <returns>int2x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator % (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise modulus.</param>
/// <returns>int2x3 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator % (int lhs, int2x3 rhs) { return new int2x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); }
/// <summary>Returns the result of a componentwise increment operation on an int2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>int2x3 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator ++ (int2x3 val) { return new int2x3 (++val.c0, ++val.c1, ++val.c2); }
/// <summary>Returns the result of a componentwise decrement operation on an int2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>int2x3 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator -- (int2x3 val) { return new int2x3 (--val.c0, --val.c1, --val.c2); }
/// <summary>Returns the result of a componentwise less than operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise less than.</param>
/// <returns>bool2x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator < (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); }
/// <summary>Returns the result of a componentwise less than operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise less than.</param>
/// <returns>bool2x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator < (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise less than.</param>
/// <returns>bool2x3 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator < (int lhs, int2x3 rhs) { return new bool2x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise less or equal.</param>
/// <returns>bool2x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator <= (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); }
/// <summary>Returns the result of a componentwise less or equal operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise less or equal.</param>
/// <returns>bool2x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator <= (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise less or equal.</param>
/// <returns>bool2x3 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator <= (int lhs, int2x3 rhs) { return new bool2x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise greater than.</param>
/// <returns>bool2x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator > (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); }
/// <summary>Returns the result of a componentwise greater than operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise greater than.</param>
/// <returns>bool2x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator > (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise greater than.</param>
/// <returns>bool2x3 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator > (int lhs, int2x3 rhs) { return new bool2x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator >= (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); }
/// <summary>Returns the result of a componentwise greater or equal operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise greater or equal.</param>
/// <returns>bool2x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator >= (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x3 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator >= (int lhs, int2x3 rhs) { return new bool2x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); }
/// <summary>Returns the result of a componentwise unary minus operation on an int2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>int2x3 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator - (int2x3 val) { return new int2x3 (-val.c0, -val.c1, -val.c2); }
/// <summary>Returns the result of a componentwise unary plus operation on an int2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>int2x3 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator + (int2x3 val) { return new int2x3 (+val.c0, +val.c1, +val.c2); }
/// <summary>Returns the result of a componentwise left shift operation on an int2x3 matrix by a number of bits specified by a single int.</summary>
/// <param name="x">The matrix to left shift.</param>
/// <param name="n">The number of bits to left shift.</param>
/// <returns>The result of the componentwise left shift.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator << (int2x3 x, int n) { return new int2x3 (x.c0 << n, x.c1 << n, x.c2 << n); }
/// <summary>Returns the result of a componentwise right shift operation on an int2x3 matrix by a number of bits specified by a single int.</summary>
/// <param name="x">The matrix to right shift.</param>
/// <param name="n">The number of bits to right shift.</param>
/// <returns>The result of the componentwise right shift.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator >> (int2x3 x, int n) { return new int2x3 (x.c0 >> n, x.c1 >> n, x.c2 >> n); }
/// <summary>Returns the result of a componentwise equality operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
/// <summary>Returns the result of a componentwise equality operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise equality.</param>
/// <returns>bool2x3 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator == (int lhs, int2x3 rhs) { return new bool2x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
/// <summary>Returns the result of a componentwise not equal operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise not equal.</param>
/// <returns>bool2x3 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x3 operator != (int lhs, int2x3 rhs) { return new bool2x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise not operation on an int2x3 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise bitwise not.</param>
/// <returns>int2x3 result of the componentwise bitwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator ~ (int2x3 val) { return new int2x3 (~val.c0, ~val.c1, ~val.c2); }
/// <summary>Returns the result of a componentwise bitwise and operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise bitwise and.</param>
/// <returns>int2x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator & (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise and operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise bitwise and.</param>
/// <returns>int2x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator & (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise bitwise and.</param>
/// <returns>int2x3 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator & (int lhs, int2x3 rhs) { return new int2x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise or operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise bitwise or.</param>
/// <returns>int2x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator | (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise or operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise bitwise or.</param>
/// <returns>int2x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator | (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise bitwise or.</param>
/// <returns>int2x3 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator | (int lhs, int2x3 rhs) { return new int2x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two int2x3 matrices.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>int2x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator ^ (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int2x3 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x3 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise bitwise exclusive or.</param>
/// <returns>int2x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator ^ (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int value and an int2x3 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side int2x3 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>int2x3 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 operator ^ (int lhs, int2x3 rhs) { return new int2x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); }
/// <summary>Returns the int2 element at a specified index.</summary>
unsafe public ref int2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 3)
throw new System.ArgumentException("index must be between[0...2]");
#endif
fixed (int2x3* array = &this) { return ref ((int2*)array)[index]; }
}
}
/// <summary>Returns true if the int2x3 is equal to a given int2x3, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(int2x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
/// <summary>Returns true if the int2x3 is equal to a given int2x3, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is int2x3 converted && Equals(converted); }
/// <summary>Returns a hash code for the int2x3.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the int2x3.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("int2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y);
}
/// <summary>Returns a string representation of the int2x3 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("int2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a int2x3 matrix constructed from three int2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <returns>int2x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(int2 c0, int2 c1, int2 c2) { return new int2x3(c0, c1, c2); }
/// <summary>Returns a int2x3 matrix constructed from from 6 int values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <returns>int2x3 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(int m00, int m01, int m02,
int m10, int m11, int m12)
{
return new int2x3(m00, m01, m02,
m10, m11, m12);
}
/// <summary>Returns a int2x3 matrix constructed from a single int value by assigning it to every component.</summary>
/// <param name="v">int to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(int v) { return new int2x3(v); }
/// <summary>Returns a int2x3 matrix constructed from a single bool value by converting it to int and assigning it to every component.</summary>
/// <param name="v">bool to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(bool v) { return new int2x3(v); }
/// <summary>Return a int2x3 matrix constructed from a bool2x3 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x3 to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(bool2x3 v) { return new int2x3(v); }
/// <summary>Returns a int2x3 matrix constructed from a single uint value by converting it to int and assigning it to every component.</summary>
/// <param name="v">uint to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(uint v) { return new int2x3(v); }
/// <summary>Return a int2x3 matrix constructed from a uint2x3 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x3 to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(uint2x3 v) { return new int2x3(v); }
/// <summary>Returns a int2x3 matrix constructed from a single float value by converting it to int and assigning it to every component.</summary>
/// <param name="v">float to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(float v) { return new int2x3(v); }
/// <summary>Return a int2x3 matrix constructed from a float2x3 matrix by componentwise conversion.</summary>
/// <param name="v">float2x3 to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(float2x3 v) { return new int2x3(v); }
/// <summary>Returns a int2x3 matrix constructed from a single double value by converting it to int and assigning it to every component.</summary>
/// <param name="v">double to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(double v) { return new int2x3(v); }
/// <summary>Return a int2x3 matrix constructed from a double2x3 matrix by componentwise conversion.</summary>
/// <param name="v">double2x3 to convert to int2x3</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x3 int2x3(double2x3 v) { return new int2x3(v); }
/// <summary>Return the int3x2 transpose of a int2x3 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int3x2 transpose(int2x3 v)
{
return int3x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y,
v.c2.x, v.c2.y);
}
/// <summary>Returns a uint hash code of a int2x3 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(int2x3 v)
{
return csum(asuint(v.c0) * uint2(0xCAE78587u, 0x7A1541C9u) +
asuint(v.c1) * uint2(0xF83BD927u, 0x6A243BCBu) +
asuint(v.c2) * uint2(0x509B84C9u, 0x91D13847u)) + 0x52F7230Fu;
}
/// <summary>
/// Returns a uint2 vector hash code of a int2x3 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(int2x3 v)
{
return (asuint(v.c0) * uint2(0xCF286E83u, 0xE121E6ADu) +
asuint(v.c1) * uint2(0xC9CA1249u, 0x69B60C81u) +
asuint(v.c2) * uint2(0xE0EB6C25u, 0xF648BEABu)) + 0x6BDB2B07u;
}
}
}

View File

@@ -0,0 +1,756 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using Unity.IL2CPP.CompilerServices;
#pragma warning disable 0660, 0661
namespace Unity.Mathematics
{
/// <summary>A 2x4 matrix of ints.</summary>
[System.Serializable]
[Il2CppEagerStaticClassConstruction]
public partial struct int2x4 : System.IEquatable<int2x4>, IFormattable
{
/// <summary>Column 0 of the matrix.</summary>
public int2 c0;
/// <summary>Column 1 of the matrix.</summary>
public int2 c1;
/// <summary>Column 2 of the matrix.</summary>
public int2 c2;
/// <summary>Column 3 of the matrix.</summary>
public int2 c3;
/// <summary>int2x4 zero value.</summary>
public static readonly int2x4 zero;
/// <summary>Constructs a int2x4 matrix from four int2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(int2 c0, int2 c1, int2 c2, int2 c3)
{
this.c0 = c0;
this.c1 = c1;
this.c2 = c2;
this.c3 = c3;
}
/// <summary>Constructs a int2x4 matrix from 8 int values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(int m00, int m01, int m02, int m03,
int m10, int m11, int m12, int m13)
{
this.c0 = new int2(m00, m10);
this.c1 = new int2(m01, m11);
this.c2 = new int2(m02, m12);
this.c3 = new int2(m03, m13);
}
/// <summary>Constructs a int2x4 matrix from a single int value by assigning it to every component.</summary>
/// <param name="v">int to convert to int2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(int v)
{
this.c0 = v;
this.c1 = v;
this.c2 = v;
this.c3 = v;
}
/// <summary>Constructs a int2x4 matrix from a single bool value by converting it to int and assigning it to every component.</summary>
/// <param name="v">bool to convert to int2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(bool v)
{
this.c0 = math.select(new int2(0), new int2(1), v);
this.c1 = math.select(new int2(0), new int2(1), v);
this.c2 = math.select(new int2(0), new int2(1), v);
this.c3 = math.select(new int2(0), new int2(1), v);
}
/// <summary>Constructs a int2x4 matrix from a bool2x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x4 to convert to int2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(bool2x4 v)
{
this.c0 = math.select(new int2(0), new int2(1), v.c0);
this.c1 = math.select(new int2(0), new int2(1), v.c1);
this.c2 = math.select(new int2(0), new int2(1), v.c2);
this.c3 = math.select(new int2(0), new int2(1), v.c3);
}
/// <summary>Constructs a int2x4 matrix from a single uint value by converting it to int and assigning it to every component.</summary>
/// <param name="v">uint to convert to int2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(uint v)
{
this.c0 = (int2)v;
this.c1 = (int2)v;
this.c2 = (int2)v;
this.c3 = (int2)v;
}
/// <summary>Constructs a int2x4 matrix from a uint2x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x4 to convert to int2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(uint2x4 v)
{
this.c0 = (int2)v.c0;
this.c1 = (int2)v.c1;
this.c2 = (int2)v.c2;
this.c3 = (int2)v.c3;
}
/// <summary>Constructs a int2x4 matrix from a single float value by converting it to int and assigning it to every component.</summary>
/// <param name="v">float to convert to int2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(float v)
{
this.c0 = (int2)v;
this.c1 = (int2)v;
this.c2 = (int2)v;
this.c3 = (int2)v;
}
/// <summary>Constructs a int2x4 matrix from a float2x4 matrix by componentwise conversion.</summary>
/// <param name="v">float2x4 to convert to int2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(float2x4 v)
{
this.c0 = (int2)v.c0;
this.c1 = (int2)v.c1;
this.c2 = (int2)v.c2;
this.c3 = (int2)v.c3;
}
/// <summary>Constructs a int2x4 matrix from a single double value by converting it to int and assigning it to every component.</summary>
/// <param name="v">double to convert to int2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(double v)
{
this.c0 = (int2)v;
this.c1 = (int2)v;
this.c2 = (int2)v;
this.c3 = (int2)v;
}
/// <summary>Constructs a int2x4 matrix from a double2x4 matrix by componentwise conversion.</summary>
/// <param name="v">double2x4 to convert to int2x4</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int2x4(double2x4 v)
{
this.c0 = (int2)v.c0;
this.c1 = (int2)v.c1;
this.c2 = (int2)v.c2;
this.c3 = (int2)v.c3;
}
/// <summary>Implicitly converts a single int value to a int2x4 matrix by assigning it to every component.</summary>
/// <param name="v">int to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator int2x4(int v) { return new int2x4(v); }
/// <summary>Explicitly converts a single bool value to a int2x4 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">bool to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x4(bool v) { return new int2x4(v); }
/// <summary>Explicitly converts a bool2x4 matrix to a int2x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x4 to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x4(bool2x4 v) { return new int2x4(v); }
/// <summary>Explicitly converts a single uint value to a int2x4 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">uint to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x4(uint v) { return new int2x4(v); }
/// <summary>Explicitly converts a uint2x4 matrix to a int2x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x4 to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x4(uint2x4 v) { return new int2x4(v); }
/// <summary>Explicitly converts a single float value to a int2x4 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">float to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x4(float v) { return new int2x4(v); }
/// <summary>Explicitly converts a float2x4 matrix to a int2x4 matrix by componentwise conversion.</summary>
/// <param name="v">float2x4 to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x4(float2x4 v) { return new int2x4(v); }
/// <summary>Explicitly converts a single double value to a int2x4 matrix by converting it to int and assigning it to every component.</summary>
/// <param name="v">double to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x4(double v) { return new int2x4(v); }
/// <summary>Explicitly converts a double2x4 matrix to a int2x4 matrix by componentwise conversion.</summary>
/// <param name="v">double2x4 to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static explicit operator int2x4(double2x4 v) { return new int2x4(v); }
/// <summary>Returns the result of a componentwise multiplication operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise multiplication.</param>
/// <returns>int2x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator * (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
/// <summary>Returns the result of a componentwise multiplication operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise multiplication.</param>
/// <returns>int2x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator * (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
/// <summary>Returns the result of a componentwise multiplication operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise multiplication.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise multiplication.</param>
/// <returns>int2x4 result of the componentwise multiplication.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator * (int lhs, int2x4 rhs) { return new int2x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise addition.</param>
/// <returns>int2x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator + (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
/// <summary>Returns the result of a componentwise addition operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise addition.</param>
/// <returns>int2x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator + (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
/// <summary>Returns the result of a componentwise addition operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise addition.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise addition.</param>
/// <returns>int2x4 result of the componentwise addition.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator + (int lhs, int2x4 rhs) { return new int2x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise subtraction.</param>
/// <returns>int2x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator - (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
/// <summary>Returns the result of a componentwise subtraction operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise subtraction.</param>
/// <returns>int2x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator - (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
/// <summary>Returns the result of a componentwise subtraction operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise subtraction.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise subtraction.</param>
/// <returns>int2x4 result of the componentwise subtraction.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator - (int lhs, int2x4 rhs) { return new int2x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise division.</param>
/// <returns>int2x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator / (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
/// <summary>Returns the result of a componentwise division operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise division.</param>
/// <returns>int2x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator / (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
/// <summary>Returns the result of a componentwise division operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise division.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise division.</param>
/// <returns>int2x4 result of the componentwise division.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator / (int lhs, int2x4 rhs) { return new int2x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise modulus.</param>
/// <returns>int2x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator % (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
/// <summary>Returns the result of a componentwise modulus operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise modulus.</param>
/// <returns>int2x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator % (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
/// <summary>Returns the result of a componentwise modulus operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise modulus.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise modulus.</param>
/// <returns>int2x4 result of the componentwise modulus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator % (int lhs, int2x4 rhs) { return new int2x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
/// <summary>Returns the result of a componentwise increment operation on an int2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise increment.</param>
/// <returns>int2x4 result of the componentwise increment.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator ++ (int2x4 val) { return new int2x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
/// <summary>Returns the result of a componentwise decrement operation on an int2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise decrement.</param>
/// <returns>int2x4 result of the componentwise decrement.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator -- (int2x4 val) { return new int2x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
/// <summary>Returns the result of a componentwise less than operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise less than.</param>
/// <returns>bool2x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator < (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
/// <summary>Returns the result of a componentwise less than operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise less than.</param>
/// <returns>bool2x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator < (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
/// <summary>Returns the result of a componentwise less than operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise less than.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise less than.</param>
/// <returns>bool2x4 result of the componentwise less than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator < (int lhs, int2x4 rhs) { return new bool2x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise less or equal.</param>
/// <returns>bool2x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator <= (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
/// <summary>Returns the result of a componentwise less or equal operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise less or equal.</param>
/// <returns>bool2x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator <= (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
/// <summary>Returns the result of a componentwise less or equal operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise less or equal.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise less or equal.</param>
/// <returns>bool2x4 result of the componentwise less or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator <= (int lhs, int2x4 rhs) { return new bool2x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise greater than.</param>
/// <returns>bool2x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator > (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
/// <summary>Returns the result of a componentwise greater than operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise greater than.</param>
/// <returns>bool2x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator > (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
/// <summary>Returns the result of a componentwise greater than operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise greater than.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise greater than.</param>
/// <returns>bool2x4 result of the componentwise greater than.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator > (int lhs, int2x4 rhs) { return new bool2x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator >= (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
/// <summary>Returns the result of a componentwise greater or equal operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise greater or equal.</param>
/// <returns>bool2x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator >= (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
/// <summary>Returns the result of a componentwise greater or equal operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise greater or equal.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise greater or equal.</param>
/// <returns>bool2x4 result of the componentwise greater or equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator >= (int lhs, int2x4 rhs) { return new bool2x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
/// <summary>Returns the result of a componentwise unary minus operation on an int2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary minus.</param>
/// <returns>int2x4 result of the componentwise unary minus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator - (int2x4 val) { return new int2x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
/// <summary>Returns the result of a componentwise unary plus operation on an int2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise unary plus.</param>
/// <returns>int2x4 result of the componentwise unary plus.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator + (int2x4 val) { return new int2x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
/// <summary>Returns the result of a componentwise left shift operation on an int2x4 matrix by a number of bits specified by a single int.</summary>
/// <param name="x">The matrix to left shift.</param>
/// <param name="n">The number of bits to left shift.</param>
/// <returns>The result of the componentwise left shift.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator << (int2x4 x, int n) { return new int2x4 (x.c0 << n, x.c1 << n, x.c2 << n, x.c3 << n); }
/// <summary>Returns the result of a componentwise right shift operation on an int2x4 matrix by a number of bits specified by a single int.</summary>
/// <param name="x">The matrix to right shift.</param>
/// <param name="n">The number of bits to right shift.</param>
/// <returns>The result of the componentwise right shift.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator >> (int2x4 x, int n) { return new int2x4 (x.c0 >> n, x.c1 >> n, x.c2 >> n, x.c3 >> n); }
/// <summary>Returns the result of a componentwise equality operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
/// <summary>Returns the result of a componentwise equality operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
/// <summary>Returns the result of a componentwise equality operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise equality.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise equality.</param>
/// <returns>bool2x4 result of the componentwise equality.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator == (int lhs, int2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
/// <summary>Returns the result of a componentwise not equal operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
/// <summary>Returns the result of a componentwise not equal operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise not equal.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise not equal.</param>
/// <returns>bool2x4 result of the componentwise not equal.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2x4 operator != (int lhs, int2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise not operation on an int2x4 matrix.</summary>
/// <param name="val">Value to use when computing the componentwise bitwise not.</param>
/// <returns>int2x4 result of the componentwise bitwise not.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator ~ (int2x4 val) { return new int2x4 (~val.c0, ~val.c1, ~val.c2, ~val.c3); }
/// <summary>Returns the result of a componentwise bitwise and operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise bitwise and.</param>
/// <returns>int2x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator & (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise and operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise bitwise and.</param>
/// <returns>int2x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator & (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); }
/// <summary>Returns the result of a componentwise bitwise and operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise bitwise and.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise bitwise and.</param>
/// <returns>int2x4 result of the componentwise bitwise and.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator & (int lhs, int2x4 rhs) { return new int2x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise or operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise bitwise or.</param>
/// <returns>int2x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator | (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise or operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise bitwise or.</param>
/// <returns>int2x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator | (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); }
/// <summary>Returns the result of a componentwise bitwise or operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise bitwise or.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise bitwise or.</param>
/// <returns>int2x4 result of the componentwise bitwise or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator | (int lhs, int2x4 rhs) { return new int2x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on two int2x4 matrices.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>int2x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator ^ (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int2x4 matrix and an int value.</summary>
/// <param name="lhs">Left hand side int2x4 to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side int to use to compute componentwise bitwise exclusive or.</param>
/// <returns>int2x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator ^ (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); }
/// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int value and an int2x4 matrix.</summary>
/// <param name="lhs">Left hand side int to use to compute componentwise bitwise exclusive or.</param>
/// <param name="rhs">Right hand side int2x4 to use to compute componentwise bitwise exclusive or.</param>
/// <returns>int2x4 result of the componentwise bitwise exclusive or.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 operator ^ (int lhs, int2x4 rhs) { return new int2x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); }
/// <summary>Returns the int2 element at a specified index.</summary>
unsafe public ref int2 this[int index]
{
get
{
#if ENABLE_UNITY_COLLECTIONS_CHECKS
if ((uint)index >= 4)
throw new System.ArgumentException("index must be between[0...3]");
#endif
fixed (int2x4* array = &this) { return ref ((int2*)array)[index]; }
}
}
/// <summary>Returns true if the int2x4 is equal to a given int2x4, false otherwise.</summary>
/// <param name="rhs">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(int2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
/// <summary>Returns true if the int2x4 is equal to a given int2x4, false otherwise.</summary>
/// <param name="o">Right hand side argument to compare equality with.</param>
/// <returns>The result of the equality comparison.</returns>
public override bool Equals(object o) { return o is int2x4 converted && Equals(converted); }
/// <summary>Returns a hash code for the int2x4.</summary>
/// <returns>The computed hash code.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode() { return (int)math.hash(this); }
/// <summary>Returns a string representation of the int2x4.</summary>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString()
{
return string.Format("int2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y);
}
/// <summary>Returns a string representation of the int2x4 using a specified format and culture-specific format information.</summary>
/// <param name="format">Format string to use during string formatting.</param>
/// <param name="formatProvider">Format provider to use during string formatting.</param>
/// <returns>String representation of the value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string ToString(string format, IFormatProvider formatProvider)
{
return string.Format("int2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider));
}
}
public static partial class math
{
/// <summary>Returns a int2x4 matrix constructed from four int2 vectors.</summary>
/// <param name="c0">The matrix column c0 will be set to this value.</param>
/// <param name="c1">The matrix column c1 will be set to this value.</param>
/// <param name="c2">The matrix column c2 will be set to this value.</param>
/// <param name="c3">The matrix column c3 will be set to this value.</param>
/// <returns>int2x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(int2 c0, int2 c1, int2 c2, int2 c3) { return new int2x4(c0, c1, c2, c3); }
/// <summary>Returns a int2x4 matrix constructed from from 8 int values given in row-major order.</summary>
/// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
/// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
/// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
/// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
/// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
/// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
/// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
/// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
/// <returns>int2x4 constructed from arguments.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(int m00, int m01, int m02, int m03,
int m10, int m11, int m12, int m13)
{
return new int2x4(m00, m01, m02, m03,
m10, m11, m12, m13);
}
/// <summary>Returns a int2x4 matrix constructed from a single int value by assigning it to every component.</summary>
/// <param name="v">int to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(int v) { return new int2x4(v); }
/// <summary>Returns a int2x4 matrix constructed from a single bool value by converting it to int and assigning it to every component.</summary>
/// <param name="v">bool to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(bool v) { return new int2x4(v); }
/// <summary>Return a int2x4 matrix constructed from a bool2x4 matrix by componentwise conversion.</summary>
/// <param name="v">bool2x4 to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(bool2x4 v) { return new int2x4(v); }
/// <summary>Returns a int2x4 matrix constructed from a single uint value by converting it to int and assigning it to every component.</summary>
/// <param name="v">uint to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(uint v) { return new int2x4(v); }
/// <summary>Return a int2x4 matrix constructed from a uint2x4 matrix by componentwise conversion.</summary>
/// <param name="v">uint2x4 to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(uint2x4 v) { return new int2x4(v); }
/// <summary>Returns a int2x4 matrix constructed from a single float value by converting it to int and assigning it to every component.</summary>
/// <param name="v">float to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(float v) { return new int2x4(v); }
/// <summary>Return a int2x4 matrix constructed from a float2x4 matrix by componentwise conversion.</summary>
/// <param name="v">float2x4 to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(float2x4 v) { return new int2x4(v); }
/// <summary>Returns a int2x4 matrix constructed from a single double value by converting it to int and assigning it to every component.</summary>
/// <param name="v">double to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(double v) { return new int2x4(v); }
/// <summary>Return a int2x4 matrix constructed from a double2x4 matrix by componentwise conversion.</summary>
/// <param name="v">double2x4 to convert to int2x4</param>
/// <returns>Converted value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int2x4 int2x4(double2x4 v) { return new int2x4(v); }
/// <summary>Return the int4x2 transpose of a int2x4 matrix.</summary>
/// <param name="v">Value to transpose.</param>
/// <returns>Transposed value.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int4x2 transpose(int2x4 v)
{
return int4x2(
v.c0.x, v.c0.y,
v.c1.x, v.c1.y,
v.c2.x, v.c2.y,
v.c3.x, v.c3.y);
}
/// <summary>Returns a uint hash code of a int2x4 matrix.</summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint hash(int2x4 v)
{
return csum(asuint(v.c0) * uint2(0x7AA07CD3u, 0xAF642BA9u) +
asuint(v.c1) * uint2(0xA8F2213Bu, 0x9F3FDC37u) +
asuint(v.c2) * uint2(0xAC60D0C3u, 0x9263662Fu) +
asuint(v.c3) * uint2(0xE69626FFu, 0xBD010EEBu)) + 0x9CEDE1D1u;
}
/// <summary>
/// Returns a uint2 vector hash code of a int2x4 matrix.
/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
/// that are only reduced to a narrow uint hash at the very end instead of at every step.
/// </summary>
/// <param name="v">Matrix value to hash.</param>
/// <returns>uint2 hash of the argument.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint2 hashwide(int2x4 v)
{
return (asuint(v.c0) * uint2(0x43BE0B51u, 0xAF836EE1u) +
asuint(v.c1) * uint2(0xB130C137u, 0x54834775u) +
asuint(v.c2) * uint2(0x7C022221u, 0xA2D00EDFu) +
asuint(v.c3) * uint2(0xA8977779u, 0x9F1C739Bu)) + 0x4B1BD187u;
}
}
}

Some files were not shown because too many files have changed in this diff Show More