场景group分suite加载、读取掉落表

This commit is contained in:
flswld
2023-03-21 23:03:00 +08:00
parent 62b929902d
commit f99d845d57
46 changed files with 1076 additions and 594 deletions

View File

@@ -161,9 +161,9 @@ func regionCubicContainPos(cubic *RegionCubic, pos *Vector3) bool {
// 检测一个点是否在球体内
func regionSphereContainPos(sphere *RegionSphere, pos *Vector3) bool {
distance3D := math.Sqrt(math.Pow(float64(sphere.pos.X-pos.X), 2) +
math.Pow(float64(sphere.pos.Y-pos.Y), 2) +
math.Pow(float64(sphere.pos.Z-pos.Z), 2))
distance3D := math.Sqrt(float64(sphere.pos.X-pos.X)*float64(sphere.pos.X-pos.X) +
float64(sphere.pos.Y-pos.Y)*float64(sphere.pos.Y-pos.Y) +
float64(sphere.pos.Z-pos.Z)*float64(sphere.pos.Z-pos.Z))
if float32(distance3D) < sphere.radius {
return true
} else {
@@ -173,8 +173,8 @@ func regionSphereContainPos(sphere *RegionSphere, pos *Vector3) bool {
// 检测一个点是否在圆柱体内
func regionCylinderContainPos(cylinder *RegionCylinder, pos *Vector3) bool {
distance2D := math.Sqrt(math.Pow(float64(cylinder.pos.X-pos.X), 2) +
math.Pow(float64(cylinder.pos.Z-pos.Z), 2))
distance2D := math.Sqrt(float64(cylinder.pos.X-pos.X)*float64(cylinder.pos.X-pos.X) +
float64(cylinder.pos.Z-pos.Z)*float64(cylinder.pos.Z-pos.Z))
if float32(distance2D) >= cylinder.radius {
return false
}