转自: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. 使用Socket的简单Web服务器

    Socket类在System.Net.Sockets命名空间 常用的操作 Bind:绑定一个本地的终结点 Listen:进入监听状态,并设置等待队列 Accept:等待一个新连接,当连接到达时,返回一 ...

  2. RF layout check list

    Analog-digital circuit 1. Insure C36 and C33 placed next to each other to avoid open stubs 2. Keep U ...

  3. PostgreSQL角色和权限理解

    1.继承的权限只是继承该组的表的权限,用户对应的管理员权限则不会被继承. 2.inherit权限是说本角色是否继承别人的权限,而不是本权限能否被别的角色继承.   postgres=# create ...

  4. Ubuntu16.04怎样安装Python3.6

    Ubuntu16.04默认安装了Python2.7和3.5 请注意,系统自带的python千万不能卸载! 输入命令python

  5. Linux下你需要了解的10个网络和监控命令

    我下面列出来的10个基础的每个linux用户都应该知道的网络和监控命令.网络和监控命令类似于这些: hostname, ping, ifconfig, iwconfig, netstat, nsloo ...

  6. Android中对文件的读写进行操作

    1. 在文件的地方生成一个read.txt文件,并且写入一个read数据.IO流用完之后一定要记得关闭. 对于try和catch是对于错误的抓取. 2. 首先先new file来找到那个文件,然后在通 ...

  7. android 自动拨打电话 挂断电话代码

    页面布局文件代码  (  res下面的layout下面的activity_main.xml代码 ) <RelativeLayout xmlns:android="http://sche ...

  8. hive split 注意事项

    hive字符串分割函数 split(str, regex) - Splits str around occurances that match regexTime taken: 0.769 secon ...

  9. dockercompose up build fail (node no such file or directory packages.json )

    docker构建项目遇到如下问题: npm ERR! Darwin 15.0.0 npm ERR! argv "/usr/local/lib/node_modules/iojs-bin/no ...

  10. Open-sourcing sso, the way we secure services at BuzzFeed

    文章来源: https://tech.buzzfeed.com/unleashing-the-a6a1a5da39d6 说明: 设计有好多地方值得借鉴,粘贴过来的排版不好 Today we are o ...