[add] 3d资源添加(箭头) 根据行驶角度调整箭头角度
This commit is contained in:
@@ -42,7 +42,7 @@ enum AdasRecognizedType {
|
||||
}
|
||||
|
||||
public static AdasRecognizedType[] VAL = {
|
||||
classIdBackground,
|
||||
classIdBackground,//0
|
||||
classIdPerson,
|
||||
classIdBicycle,
|
||||
classIdCar,
|
||||
|
||||
@@ -229,7 +229,7 @@ class BaseDrawer {
|
||||
} else if (recognizedType == AdasRecognizedType.classIdStopLine) {
|
||||
return R.raw.stopline;
|
||||
} else if (recognizedType == AdasRecognizedType.classIdWarningArrows) {
|
||||
return R.raw.stopline;
|
||||
return R.raw.arraw;
|
||||
}
|
||||
return R.raw.people;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
return marker;
|
||||
}
|
||||
|
||||
public void drawerArrowsMarkerWithLocation(MogoLatLng location, String markerType, int type) {
|
||||
public void drawerArrowsMarkerWithLocation(MogoLatLng location, String markerType, int type, int period) {
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.latitude(location.getLat())
|
||||
.longitude(location.getLon());
|
||||
|
||||
BIN
modules/mogo-module-common/src/main/res/raw/arraw.n3d
Normal file
BIN
modules/mogo-module-common/src/main/res/raw/arraw.n3d
Normal file
Binary file not shown.
@@ -7,6 +7,8 @@ import android.util.Log;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
@@ -224,13 +226,14 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
private void addArrows(MogoLatLng startLatLng, MogoLatLng endLatLng) {
|
||||
float distance = CoordinateUtils.calculateLineDistance(
|
||||
startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
|
||||
double period = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
|
||||
Log.d(TAG, "添加小箭头--目标物与预碰撞点之间的距离是" + String.valueOf(distance));
|
||||
if (distance > 5) {
|
||||
int count = (int) (distance / 5);
|
||||
for (int i = 0; i < count - 1; i++) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
MogoLatLng newLo = Trigonometric.getNewLocation(
|
||||
startLatLng, 5 * (i + 1), 120);
|
||||
V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10);
|
||||
startLatLng, 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon,startLatLng.lat,endLatLng.lon,endLatLng.lat));
|
||||
V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10, Integer.parseInt(String.valueOf(period)));
|
||||
}
|
||||
}
|
||||
//延迟3秒清理线
|
||||
|
||||
@@ -482,7 +482,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="#8BC34A"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="adas预警数据发送"
|
||||
android:text="车路云场景预警"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"from": 1,
|
||||
"angle": 0,
|
||||
"direction": 1,
|
||||
"direction": 2,
|
||||
"speed": 11.108121,
|
||||
"targetColor": "#FF4040",
|
||||
"stopLineDistance": 60,
|
||||
|
||||
Reference in New Issue
Block a user