77 lines
2.6 KiB
C++
77 lines
2.6 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "RailwayCarriage.h"
|
|
#include "Components/StaticMeshComponent.h"
|
|
#include "Components/SphereComponent.h"
|
|
|
|
|
|
// Sets default values
|
|
ARailwayCarriage::ARailwayCarriage()
|
|
{
|
|
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
|
//PrimaryActorTick.bCanEverTick = false;
|
|
// root
|
|
Root = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
|
|
RootComponent = Root;
|
|
|
|
// body mesh railway
|
|
railwayBody = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("railway"));
|
|
railwayBody->AttachTo(Root);
|
|
wheel_0 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("wheel_0"));
|
|
wheel_0->AttachTo(railwayBody);
|
|
wheel_1 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("wheel_1"));
|
|
wheel_1->AttachTo(railwayBody);
|
|
wheel_2 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("wheel_2"));
|
|
wheel_2->AttachTo(railwayBody);
|
|
wheel_3 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("wheel_3"));
|
|
wheel_3->AttachTo(railwayBody);
|
|
|
|
cart_0 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cart_0"));
|
|
cart_0->AttachTo(railwayBody);
|
|
cart_1 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cart_1"));
|
|
cart_1->AttachTo(railwayBody);
|
|
|
|
coupling_0 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("coupling_0"));
|
|
coupling_0->AttachTo(railwayBody);
|
|
coupling_1 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("coupling_1"));
|
|
coupling_1->AttachTo(railwayBody);
|
|
|
|
cartCorp_0 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cartCorp_0"));
|
|
cartCorp_0->AttachTo(wheel_0);
|
|
cartCorp_1 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cartCorp_1"));
|
|
cartCorp_1->AttachTo(wheel_0);
|
|
cartCorp_2 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cartCorp_2"));
|
|
cartCorp_2->AttachTo(wheel_1);
|
|
cartCorp_3 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cartCorp_3"));
|
|
cartCorp_3->AttachTo(wheel_1);
|
|
|
|
cartCorp_4 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cartCorp_4"));
|
|
cartCorp_4->AttachTo(wheel_2);
|
|
cartCorp_5 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cartCorp_5"));
|
|
cartCorp_5->AttachTo(wheel_2);
|
|
cartCorp_6 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cartCorp_6"));
|
|
cartCorp_6->AttachTo(wheel_3);
|
|
cartCorp_7 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("cartCorp_7"));
|
|
cartCorp_7->AttachTo(wheel_3);
|
|
|
|
|
|
|
|
}
|
|
|
|
// Called when the game starts or when spawned
|
|
void ARailwayCarriage::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
|
|
oldLocation = GetActorLocation();
|
|
}
|
|
/*
|
|
// Called every frame
|
|
void ARailwayCarriage::Tick(float DeltaTime)
|
|
{
|
|
Super::Tick(DeltaTime);
|
|
|
|
}
|
|
*/
|