
Data Arithmetic
以Unity为主、CSharp为辅
true...
计算机科班出生、QQ学习交流群:1067304356
展开
-
球的碰撞
bool CollisionBetweenSphere(sphere s1,sphere s2) { bool hit; float distanceOfCenter=sqrt(pow((s1.center.x-s2.center.x),2)+ pow((s1.center.y-s2.center.y),2)+ pow((s1.center.z-s2.center.原创 2021-03-11 00:29:10 · 168 阅读 · 0 评论 -
圆的碰撞检测
bool CollisionBetweenCircles(circle c1,circle c2) { bool hit; float distanceOfCenter=sqrt(pow((c1.center.x-c2.center.x),2)+ pow((c1.center.y-c2.center.y),2)); float distanceOfRadius=c1.radius+c2.radius; if(d.原创 2021-03-11 00:28:28 · 328 阅读 · 0 评论 -
Unity 之圆环算法
几何中我们要画一个圆,因为圆的标准表达式是 圆心为(a,b),半径为r。那么我们只要知道圆心和半径就可以了。 我们只要知道圆心,半径,和旋转弧度就可以了。 在Unity中创建测试工程,添加代码Circles using UnityEngine; using System.Collections; public class circle : MonoBehaviour { public GameObject circleModel; //旋转改变的角度 public int原创 2021-03-11 00:27:32 · 621 阅读 · 0 评论 -
UGUI-判断是否在矩阵范围内
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Matrix : MonoBehaviour { // Update is called once per frame void Update() { //Vector2 ve = RectTransformUtility.WorldToScreenPo原创 2020-11-15 20:13:45 · 251 阅读 · 0 评论