转自: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的更多相关文章

  1. 移植UE4的Spline与SplineMesh组件到Unity5

    一个月前,想开始看下UE4的源码,刚开始以为有Ogre1.9与Ogre2.1源码的基础 ,应该还容易理解,把源码下起后,发现我还是想的太简单了,UE4的代码量对比Ogre应该多了一个量级,毕竟Ogre ...

  2. 通过 C# 代码操作 Google 日历

    原文:通过 C# 代码操作 Google 日历 本文主题 借助 Google .NET APIs Client Library,通过 C# 代码在 Google 日历中创建会议邀请. 本文背景 最近, ...

  3. JavaScript后台代码操作HTML TABLE的方法

    原文:JavaScript后台代码操作HTML TABLE的方法 var rowNum = 0,fileNum = 0; //行号与列号 var oNewRow; //定义插入行对象 var oNew ...

  4. 不使用spring的情况下用java原生代码操作mongodb数据库的两种方式

    由于更改了mongodb3.0数据库的密码,导致这几天storm组对数据进行处理的时候,一直在报mongodb数据库连接不上的异常.   主要原因实际上是和mongodb本身无关的,因为他们改的是配置 ...

  5. Java代码操作HDFS测试类

    1.Java代码操作HDFS需要用到Jar包和Java类 Jar包: hadoop-common-2.6.0.jar和hadoop-hdfs-2.6.0.jar Java类: java.net.URL ...

  6. 使用java代码操作Redis

    1导入pom.xml依赖 <dependency> <groupId>redis.clients</groupId> <artifactId>jedis ...

  7. java代码操作Redis

    1.导入需要的pom依赖 <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEn ...

  8. Zookeeper学习笔记(三)——java客户端代码操作

    Zookeeper客户端java代码操作 上篇博客记录了shell命令操作zookeeper集群的方式,这次尝试采用java代码来操作.通过查阅API,发现并不困难. 1. 首先获得客户端与服务器的连 ...

  9. Java代码操作zookeeper

    .personSunflowerP { background: rgba(51, 153, 0, 0.66); border-bottom: 1px solid rgba(0, 102, 0, 1); ...

随机推荐

  1. L229 词汇题

    The incidence of lung cancer is particularly high among long-term heavy smokers,especially chain smo ...

  2. 解压Ubuntu的initrd.img的方法

    Ubuntu的initrd.img可以在/boot中找到,通常文件名后面还跟有很长的一串版本号. 为了保险起见,不直接操作原文件,而是把它复制到自己的家目(home)录中.如果你是用root帐号登录的 ...

  3. Linux C 数据结构->双向链表(阴阳在六,何以言九~)

    0. 弄完了单链表,在看双向链表.怎么整?多写,多想,想不通画出来在想,再写,再模仿~ 1.  没啥说的,敲代码~  说点啥呢,注意自己的代码风格哦,要符合"潮流",不要独树一帜 ...

  4. Okhttp之CallServerInterceptor简单分析

    在Okhttp源码分析专栏的几篇博客分析了Okhttp几个拦截器的主要功能,还剩下最后一个拦截器CallServerInterceptor没有分析,本篇博客就简单分析下该拦截器的功能. 在Okhttp ...

  5. 4.1 shell文本过滤、find、awk、grep

    文本过滤涉及到以下知识: 正则表达式.find.grep.awk.sed.合并与分割(sort.uniq.join.cut.paste.split). 正则表达式: 基本元字符集及其含义: 匹配IP地 ...

  6. Vec3b类型数据确定颜色通道

    前言 这几天实习生测试一张图像的三个通道分别是什么颜色,使用的是Vec3b类型,然后发现了一个有意思的点.. 测试过程 先创建了一定大小的数据, Mat test( , , CV_8UC3, Scal ...

  7. Unity 3D编辑器扩展介绍、教程(二) —— 创建窗口

    Unity编辑器扩展教程(二) 本文提供全流程,中文翻译.Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) 一 Brief Introd ...

  8. JAVA正则表达式-捕获组与非捕获组

    Java捕获组与非捕获组的问题 先看例子: import java.util.regex.Matcher; import java.util.regex.Pattern; public class P ...

  9. LuoguP4389 付公主的背包【生成函数+多项式exp】

    题目背景 付公主有一个可爱的背包qwq 题目描述 这个背包最多可以装10^5105大小的东西 付公主有n种商品,她要准备出摊了 每种商品体积为Vi,都有10^5105件 给定m,对于s\in [1,m ...

  10. MVC的好处 演示

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...