[UE4]C++代码操作SplineMesh
转自:http://aigo.iteye.com/blog/2279503
void ARaceSpline::OnConstruction(const FTransform& Transform)
{
for (int32 i = ; i < mSplineComponent->GetNumSplinePoints() - ; i++)
{
USplineMeshComponent* SplineMesh = ConstructObject<USplineMeshComponent>(USplineMeshComponent::StaticClass(), this); SplineMesh->bCreatedByConstructionScript = true;
SplineMesh->SetMobility(EComponentMobility::Movable);
SplineMesh->AttachParent = mSplineComponent; //Set the color!
UMaterialInstanceDynamic* dynamicMat = UMaterialInstanceDynamic::Create(mSplineMeshMaterial, NULL);
dynamicMat->SetVectorParameterValue(TEXT("Color"), FLinearColor(mSegments[i].mColor)); SplineMesh->bCastDynamicShadow = false;
SplineMesh->SetStaticMesh(mGridMesh);
SplineMesh->SetMaterial(, dynamicMat); //Width of the mesh
SplineMesh->SetStartScale(FVector2D(, ));
SplineMesh->SetEndScale(FVector2D(, )); FVector pointLocationStart, pointTangentStart, pointLocationEnd, pointTangentEnd;
mSplineComponent->GetLocalLocationAndTangentAtSplinePoint(i, pointLocationStart, pointTangentStart);
mSplineComponent->GetLocalLocationAndTangentAtSplinePoint(i + , pointLocationEnd, pointTangentEnd); SplineMesh->SetStartAndEnd(pointLocationStart, pointTangentStart, pointLocationEnd, pointTangentEnd);
} RegisterAllComponents();
}
[UE4]C++代码操作SplineMesh的更多相关文章
- 移植UE4的Spline与SplineMesh组件到Unity5
一个月前,想开始看下UE4的源码,刚开始以为有Ogre1.9与Ogre2.1源码的基础 ,应该还容易理解,把源码下起后,发现我还是想的太简单了,UE4的代码量对比Ogre应该多了一个量级,毕竟Ogre ...
- 通过 C# 代码操作 Google 日历
原文:通过 C# 代码操作 Google 日历 本文主题 借助 Google .NET APIs Client Library,通过 C# 代码在 Google 日历中创建会议邀请. 本文背景 最近, ...
- JavaScript后台代码操作HTML TABLE的方法
原文:JavaScript后台代码操作HTML TABLE的方法 var rowNum = 0,fileNum = 0; //行号与列号 var oNewRow; //定义插入行对象 var oNew ...
- 不使用spring的情况下用java原生代码操作mongodb数据库的两种方式
由于更改了mongodb3.0数据库的密码,导致这几天storm组对数据进行处理的时候,一直在报mongodb数据库连接不上的异常. 主要原因实际上是和mongodb本身无关的,因为他们改的是配置 ...
- Java代码操作HDFS测试类
1.Java代码操作HDFS需要用到Jar包和Java类 Jar包: hadoop-common-2.6.0.jar和hadoop-hdfs-2.6.0.jar Java类: java.net.URL ...
- 使用java代码操作Redis
1导入pom.xml依赖 <dependency> <groupId>redis.clients</groupId> <artifactId>jedis ...
- java代码操作Redis
1.导入需要的pom依赖 <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEn ...
- Zookeeper学习笔记(三)——java客户端代码操作
Zookeeper客户端java代码操作 上篇博客记录了shell命令操作zookeeper集群的方式,这次尝试采用java代码来操作.通过查阅API,发现并不困难. 1. 首先获得客户端与服务器的连 ...
- Java代码操作zookeeper
.personSunflowerP { background: rgba(51, 153, 0, 0.66); border-bottom: 1px solid rgba(0, 102, 0, 1); ...
随机推荐
- Tesseract-OCR 训练教程(一)
实际应用中[font]替换为你自己的字体名,比如newfont.hehe等 1.根据tif生成box文件(位置宽高等信息)tesseract [font].font.exp0.tif [font].f ...
- Iterator、Iteratable与ListIterator
Iteratable: public interface Iterable<T> { Iterator<T> iterator(); default void forEach( ...
- UIActivityIndicatorView使用
UIActivityIndicatorView显示一个标准的旋转进度轮,类似网页AJAX加载时的图标. let loadIndicator = UIActivityIndicatorView(fram ...
- SharePoint 2010: Change welcome page on PowerShell
摘要: SharePoint 2010之后呢, 建立一个 Team Site会有两个 default page, 分别是 Sitepages/home.aspx and default.aspx. 这 ...
- SharePoint 设置Library中文档的默认打开方式
在SharePoint Library中的文档, 如word, excel等, 文档有两种打开方式, 一种是Viewer in Browser, 一种是Open in Client applicati ...
- EasyTouch中多种QuickGesture手势检测
EasyTouch中QuickGesture的用法 本文提供全流程,中文翻译.Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) 1 Qu ...
- test20181015 B君的第二题
题意 分析 考场85分 用multiset暴力,由于教练的机子飞快,有写priority_queue水过了的人. #include<cstdlib> #include<cstdio& ...
- test20181006 石头剪刀布
题意 分析 考场做法同题解一样. std代码. #include<bits/stdc++.h> using namespace std; template <typename T&g ...
- Dataframe 中的 and vs &
refer to: http://dougaoyang.github.io/2017/09/22/pandas-bool-compare.html df[(df['pop']>3) and (d ...
- Start Developing iOS Apps (Swift) 开始开发iOS应用(Swift)
http://www.cnblogs.com/tianjian/category/704953.html 构建基础的用户界面 Build a Basic UI http://www.cnblogs.c ...