Skip to content

Commit e564aa7

Browse files
committed
fix 一些问题
1 parent b3ed37d commit e564aa7

File tree

7 files changed

+5
-14
lines changed

7 files changed

+5
-14
lines changed

src/main/kotlin/org/gitee/orryx/core/selector/geometry/Annular.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ object Annular : ISelectorGeometry {
3939
val max = parameter.read<Double>(1, 0.0)
4040
val high = parameter.read<Double>(2, 0.0)
4141

42-
val livingEntities = origin.world.getNearbyEntities(origin.location, max, high, max)
42+
val livingEntities = origin.world.livingEntities
4343
val list = mutableListOf<ITarget<*>>()
4444

4545
livingEntities.forEach {
@@ -99,6 +99,4 @@ object Annular : ISelectorGeometry {
9999

100100
return locations
101101
}
102-
103-
104102
}

src/main/kotlin/org/gitee/orryx/core/selector/geometry/Location.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,4 @@ object Location: ISelectorGeometry {
5757

5858
return listOf(location)
5959
}
60-
6160
}

src/main/kotlin/org/gitee/orryx/core/selector/geometry/OrientedBoundingBox.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ object OrientedBoundingBox: ISelectorGeometry {
6666
return projection <= rObb + rAabb + 1e-6
6767
}
6868

69-
// 筛选范围调整为OBB对角线的半长(避免漏检)
70-
val radius = sqrt(long * long + wide * wide + high * high) / 2
71-
val entities = origin.world.getNearbyEntities(obbCenterLocation, radius, radius, radius)
69+
val entities = origin.world.livingEntities
7270

7371
return entities.filter { entity ->
7472
val entityLoc = entity.location
@@ -141,5 +139,4 @@ object OrientedBoundingBox: ISelectorGeometry {
141139

142140
return list
143141
}
144-
145142
}

src/main/kotlin/org/gitee/orryx/core/selector/geometry/Range.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ object Range: ISelectorGeometry {
3333
val r = parameter.read<Double>(0, 10.0)
3434
val ray = RayAabIntersection()
3535

36-
val entities = origin.world.getNearbyEntities(origin.eyeLocation, r, r, r)
36+
val entities = origin.world.livingEntities
3737
return entities.mapNotNull {
3838
if (it == origin.getSource()) return@mapNotNull it.toTarget()
3939
if (it is LivingEntity) {
@@ -54,5 +54,4 @@ object Range: ISelectorGeometry {
5454

5555
return createSphere(adaptLocation(origin.eyeLocation), radius = r).calculateLocations().map { it }
5656
}
57-
5857
}

src/main/kotlin/org/gitee/orryx/core/selector/geometry/RayHit.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ object RayHit: ISelectorGeometry {
5555
private fun findEntitiesAlongRay(origin: Location, direction: Vector3d): List<Entity> {
5656
val world = origin.world ?: return emptyList()
5757

58-
val nearbyEntities = world.entities
58+
val nearbyEntities = world.livingEntities
5959

6060
// 初始化射线
6161
val ray = RayAabIntersection(

src/main/kotlin/org/gitee/orryx/core/selector/geometry/Sector.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ object Sector: ISelectorGeometry {
3434
val h = parameter.read<Double>(2, 2.0)
3535
val offsetY = parameter.read<Double>(3, 0.0)
3636

37-
val entities = origin.world.getNearbyEntities(origin.eyeLocation, r, r, r)
37+
val entities = origin.world.livingEntities
3838
val dir = origin.location.direction.clone().setY(0).normalize()
3939

4040
return entities.mapNotNull {
@@ -111,5 +111,4 @@ object Sector: ISelectorGeometry {
111111

112112
return up + down + leftUp + rightUp + leftDown + rightDown + leftPillar + rightPillar
113113
}
114-
115114
}

src/main/kotlin/org/gitee/orryx/core/selector/geometry/VectorLocation.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,4 @@ object VectorLocation: ISelectorGeometry {
6464
val loc = origin.eyeLocation.clone().add(direction)
6565
return listOf(adaptLocation(loc))
6666
}
67-
6867
}

0 commit comments

Comments
 (0)