Commit 4faa9691 authored by p x's avatar p x
Browse files

验证流光特效

parent a99826e3
......@@ -5,11 +5,11 @@ package com.sd.cavphmi.highmap
* 传入点的坐标数组绘制路面状况颜色2=(路径里的红色、施工区域红色、人行道红色) 3=绿色(绿波) 4=感知车前的红色)
*/
data class AlertPath(
val alertLins: List<AlertLin>,
val lines: List<AlertLine>,
val alertType: Int
)
class AlertLin {
class AlertLine {
// val evel: Int,
var lat: Double=0.0
var lon: Double=0.0
......
......@@ -4,5 +4,5 @@ package com.sd.cavphmi.highmap
* 开启(关闭)绘制主车底盘下的光圈
*/
data class BottomCircle(
val ison: Boolean
val isOn: Boolean
)
\ No newline at end of file
......@@ -7,8 +7,15 @@ data class CarNavPath(
val lines: List<AllLine>
)
data class AllLine(
// val evel: Int,
val lat: Double,
val lon: Double
)
\ No newline at end of file
class AllLine {
// val evel: Int,
constructor()
constructor(lat: Double, lon: Double){
this.lat = lat
this.lon = lon
}
var lat: Double=0.0
var lon: Double=0.0
}
\ No newline at end of file
......@@ -45,13 +45,14 @@ object HighMapApi {
/**
* 开启(关闭)绘制主车底盘下的光圈
*/
fun setCarBottomCircle(ison: Boolean) {
var bottomCircle = BottomCircle(ison)
fun setCarBottomCircle(isOn: Boolean) {
var bottomCircle = BottomCircle(isOn)
UnityPlayer.UnitySendMessage(MODELNAME, "SetCarBottomCircle", gson.toJson(bottomCircle))
}
/**
* 开启(关闭)主车前方的雷达6个方向
* 0=关闭 1=左前 2=正前 3=右前 4=右后 5=正后 6=左后
*/
fun setCarRadarDirection(dirent: Int) {
var radarDirection = RadarDirection(dirent)
......@@ -72,8 +73,8 @@ object HighMapApi {
* @param alertLins 危险路径
* @param alertType 危险类型
*/
fun setAlertPath(alertLins: List<AlertLin>, alertType: Int) {
var alertPath = AlertPath(alertLins, alertType)
fun setAlertPath(alertLine: List<AlertLine>, alertType: Int) {
var alertPath = AlertPath(alertLine, alertType)
UnityPlayer.UnitySendMessage(MODELNAME, "SetAlertPath", gson.toJson(alertPath))
}
......@@ -102,4 +103,18 @@ object HighMapApi {
UnityPlayer.UnitySendMessage(MODELNAME, "ClearAllPtcData", "{}")
}
/**
* 选中车位的动效(四周流光效果加一个P的弹跳)
* @param spaceCode 车位编号
* 目前测试ID范围:B001~B075
*/
fun parkRoundLight(spaceCode: String){
var parkRoundLight = ParkRoundLight().apply {
this.spaceCode = spaceCode
}
UnityPlayer.UnitySendMessage(MODELNAME, "parkRoundLight", gson.toJson(parkRoundLight))
}
}
\ No newline at end of file
package com.sd.cavphmi.highmap
/**
* Park round light
* 停车位流光特效
*/
class ParkRoundLight {
//车位编号
var spaceCode = ""
}
\ No newline at end of file
package com.sd.cavphmi.highmap
/**
* 感知物数据
*
......@@ -27,6 +28,7 @@ data class PtcData(
class UnityPtc {
//闪烁时间
var aniTime = 0L
//感知物类型 1=车 2=人
var pType = 0
var heading = 0.0
var isFlash = false
......
......@@ -155,6 +155,10 @@ class MainActivity : BaseActivity<ActivityMainBinding, MyBaseViewModel>(),
dialog.setOnItemClickListener(this)
dialog.show()
}
//车位四周流光
binding.btParkround.setOnClickListener {
HighMapApi.parkRoundLight("B050")
}
}
......
......@@ -98,7 +98,7 @@ class UnityFragment : Fragment(), IUnityPlayerLifecycleEvents {
mUnityPlayer.windowFocusChanged(true)
// mUnityPlayer.requestFocus()
//使用拼接服务器资源加载地图
unityMapVm.loadTileJson()
// unityMapVm.loadTileJson()
}
......
......@@ -26,7 +26,7 @@ object MyContants {
//websocket地址
private var WSHOST = if (IS_DEBUG) "wss://${BASE_HOST}/wsplus/socket?token=121&reType=freedo&" else "wss://${BASE_HOST}/wsplus/socket?token=121&reType=freedo&"
var vehicleId = "17"
var vehicleId = "YZMN004"
/**网联车辆位姿 用于实车测试喽数据***/
var WS_VEH_LOC = "${WSHOST}msgType=2&vehicleId=${vehicleId}"
......
......@@ -80,6 +80,13 @@
android:text="网联车辆状态"
android:visibility="gone" />
<Button
android:id="@+id/bt_parkround"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="车位四周流光"
/>
<Button
android:id="@+id/bt_setcar"
android:layout_width="wrap_content"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment