[FR] math.all + math.any for multi dimensional boolean
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- csharp
调研方向
该 issue 未指定文件或测试;请在 Unity.Mathematics 源码中搜索现有的 math.all 和 math.any 向量重载,并检查矩阵类型如何公开其列。为列出的 bool2x2 到 bool4x4 情况添加相应支持,然后验证示例多维布尔表达式能够编译,并按轴产生所要求的结果。
由索引模型根据 Issue 内容生成。
描述
public static bool2 all(bool2x2 m) { return new bool2(all(m.c0),all(m.c1)); }
public static bool2 all(bool3x2 m) { return new bool2(all(m.c0),all(m.c1)); }
public static bool2 all(bool4x2 m) { return new bool2(all(m.c0),all(m.c1)); }
public static bool2 any(bool2x2 m) { return new bool2(any(m.c0),any(m.c1)); }
public static bool2 any(bool3x2 m) { return new bool2(any(m.c0),any(m.c1)); }
public static bool2 any(bool4x2 m) { return new bool2(any(m.c0),any(m.c1)); }
public static bool3 all(bool2x3 m) { return new bool3(all(m.c0),all(m.c1),all(m.c2)); }
public static bool3 all(bool3x3 m) { return new bool3(all(m.c0),all(m.c1),all(m.c2)); }
public static bool3 all(bool4x3 m) { return new bool3(all(m.c0),all(m.c1),all(m.c2)); }
public static bool3 any(bool2x3 m) { return new bool3(any(m.c0),any(m.c1),any(m.c2)); }
public static bool3 any(bool3x3 m) { return new bool3(any(m.c0),any(m.c1),any(m.c2)); }
public static bool3 any(bool4x3 m) { return new bool3(any(m.c0),any(m.c1),any(m.c2)); }
public static bool4 all(bool2x4 m) { return new bool4(all(m.c0),all(m.c1),all(m.c2),all(m.c3)); }
public static bool4 all(bool3x4 m) { return new bool4(all(m.c0),all(m.c1),all(m.c2),all(m.c3)); }
public static bool4 all(bool4x4 m) { return new bool4(all(m.c0),all(m.c1),all(m.c2),all(m.c3)); }
public static bool4 any(bool2x4 m) { return new bool4(any(m.c0),any(m.c1),any(m.c2),any(m.c3)); }
public static bool4 any(bool3x4 m) { return new bool4(any(m.c0),any(m.c1),any(m.c2),any(m.c3)); }
public static bool4 any(bool4x4 m) { return new bool4(any(m.c0),any(m.c1),any(m.c2),any(m.c3)); }
Sample use case
int[] vertexTriangles; // index buffer of mesh
var rightEdge = new int3(0,1,4); // index of vertex on the right of uv rectangle
var topEdge = new int3(1,3,4); // index of vertex on the top of uv rectangle
var rightTop = new int3x2(new int3(0,1,4),new int3(1,3,4));
foreach(int index in vertexTriangles)
{
bool3x2 checkRightTop = index % 6 == rightTop;
bool2 isRightTop = math.any(checkRightTop); // check that vertexIndex is which corner of UV space
// isRightTop.x is left or right
// isRightTop.y is bottom or top
var v = math.select(rightTopValue,leftBottomValue,isRightTop); // select leftTop/rightTop/leftBottom/rightBottom
}
- 主要语言
- C#
- 星标
- 1.4k
- 派生
- 159
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Unity-Technologies/Unity.Mathematics 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 2/5 1-3 小时 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 5/5 一周以上 新手友好度 25/100
Unity-Technologies/Unity.Mathematics#245 · 3 条评论 ·
-
难度 3/5 1-2 天 新手友好度 42/100
Unity-Technologies/Unity.Mathematics#243 · 6 个 reaction ·
查看 Unity-Technologies/Unity.Mathematics 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
builtbybel/CrapFixer#112 ·
-
area-ai untriaged
难度 2/5 1-3 小时 新手友好度 85/100
dotnet/extensions#7790 ·
维护者通常 1 天内回复
-
Beginner Friendly T: Bugfix
难度 2/5 1-3 小时 新手友好度 82/100
space-wizards/space-station-14#46220 ·
维护者通常 1 天内回复
-
P2 testing
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
area-Infrastructure-coreclr os-ios os-maccatalyst os-tvos untriaged
难度 2/5 1-3 小时 新手友好度 78/100
dotnet/runtime#134766 · 3 条评论 ·
维护者通常 1 天内回复